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) {
135
135
}
136
136
if _ , ok := w .items [key ]; ! ok {
137
137
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 ,
143
142
}
144
143
w .items [key ] = item
145
144
w .queue .ReplaceOrInsert (item )
@@ -305,19 +304,14 @@ func less[T comparable](a, b *item[T]) bool {
305
304
return a .priority > b .priority
306
305
}
307
306
308
- if a .addedAtUnixNano != b .addedAtUnixNano {
309
- return a .addedAtUnixNano < b .addedAtUnixNano
310
- }
311
-
312
307
return a .addedCounter < b .addedCounter
313
308
}
314
309
315
310
type 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
321
315
}
322
316
323
317
func (w * priorityqueue [T ]) updateUnfinishedWorkLoop () {
You can’t perform that action at this time.
0 commit comments