forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This refactors expirable map to make it so that deleting expired entries is cheap (not looping over the whole map, but looping only over the known expired entries). This increases the memory requirements though because the key of type `K` is now cloned an extra time to be stored in the inverse map. A solution for the potentially expensive cloning is to wrap the key in an Arc, but, looking at the usage of expirable map, it looks like most (actually all) of the times, the keys are integer IDs, which are cheaply cloned/copied. So leaving this as a direct clone for now until the need arises.
- Loading branch information
1 parent
48f5ddd
commit 62d26c7
Showing
4 changed files
with
52 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters