mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-29 11:01:57 +00:00
Fix LruCache when next_score overflows
This commit is contained in:
parent
4a7194d2df
commit
8b5d9d33ab
@ -114,7 +114,7 @@ void LruCache<TKey, TValue>::IncrementScore() {
|
||||
// Overflow.
|
||||
if (next_score_ == 0) {
|
||||
std::sort(entries_.begin(), entries_.end(), [](const Entry& a, const Entry& b) {
|
||||
return a.score > b.score;
|
||||
return a.score < b.score;
|
||||
});
|
||||
for (Entry& entry : entries_)
|
||||
entry.score = next_score_++;
|
||||
|
Loading…
Reference in New Issue
Block a user