Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix stuck in LruCache after updating items (#3365)
Inside the LruCache, it always create a new link node when doing the []= operator, what if we're doing the "updating" operation? The _entries will replace the new value to the same key entry, but the link list will have two nodes with a same key, once the capacity is exhausted, the application will stuck in removing item as the second removing with the same key changes nothing. You can reproduce this case by executing the test cases provided by this PR.
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
## 7.2.4-dev | ||
|
||
- Fix some new lints. | ||
- Fix a bug in the LRU cache. | ||
|
||
## 7.2.3 | ||
|
||
|
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