File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
pkg/controller/priorityqueue Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -135,11 +135,10 @@ func (w *priorityqueue[T]) AddWithOpts(o AddOpts, items ...T) {
135135 }
136136 if _ , ok := w .items [key ]; ! ok {
137137 item := & item [T ]{
138- key : key ,
139- addedAtUnixNano : w .now ().UnixNano (),
140- addedCounter : w .addedCounter ,
141- priority : o .Priority ,
142- readyAt : readyAt ,
138+ key : key ,
139+ addedCounter : w .addedCounter ,
140+ priority : o .Priority ,
141+ readyAt : readyAt ,
143142 }
144143 w .items [key ] = item
145144 w .queue .ReplaceOrInsert (item )
@@ -305,19 +304,14 @@ func less[T comparable](a, b *item[T]) bool {
305304 return a .priority > b .priority
306305 }
307306
308- if a .addedAtUnixNano != b .addedAtUnixNano {
309- return a .addedAtUnixNano < b .addedAtUnixNano
310- }
311-
312307 return a .addedCounter < b .addedCounter
313308}
314309
315310type item [T comparable ] struct {
316- key T
317- addedAtUnixNano int64
318- addedCounter uint64
319- priority int
320- readyAt * time.Time
311+ key T
312+ addedCounter uint64
313+ priority int
314+ readyAt * time.Time
321315}
322316
323317func (w * priorityqueue [T ]) updateUnfinishedWorkLoop () {
You can’t perform that action at this time.
0 commit comments