Commit 8ccbd17
Optimize Count(), fix debug assert, and fix SetExpiration cleanup
- Count(): fast-path when no expirations are due yet (peek min), iterate
RawHeap instead of sortedSetDict for expired count
- Add RawHeap property to IndexedPriorityQueue for fast iteration
- Fix Debug.Assert to use correct minimum (SortedSetOverhead + DictionaryOverhead)
- Fix SetExpiration: remove from expirationQueue when expiration is in the past
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 81ac050 commit 8ccbd17
2 files changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
579 | 581 | | |
580 | | - | |
| 582 | + | |
| 583 | + | |
581 | 584 | | |
| 585 | + | |
582 | 586 | | |
583 | 587 | | |
584 | 588 | | |
| |||
616 | 620 | | |
617 | 621 | | |
618 | 622 | | |
619 | | - | |
| 623 | + | |
620 | 624 | | |
621 | 625 | | |
622 | 626 | | |
| |||
669 | 673 | | |
670 | 674 | | |
671 | 675 | | |
| 676 | + | |
672 | 677 | | |
673 | 678 | | |
674 | 679 | | |
| |||
0 commit comments