Repository navigation
Commit caf9cbc
Find a LongLivedObject in its collection without walking it (#59403)
* Find a LongLivedObject in its collection without walking it
LongLivedObjectCollection::remove walked the whole set to find the
object, so releasing N pending callbacks or promises cost O(N^2). Look it
up with a non-owning shared_ptr instead, which hashes and compares by the
same pointer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Name the lookup key in LongLivedObjectCollection::remove
Address review: make it explicit that the key is a non-owning alias.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent b86c82c commit caf9cbc
1 file changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
0 commit comments