Changeset View
Changeset View
Standalone View
Standalone View
src/core/lrucache.h
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 82 | { | |||
---|---|---|---|---|---|
89 | std::rotate(mEntries.begin(), | 89 | std::rotate(mEntries.begin(), | ||
90 | std::next(mEntries.begin(), mNumEntries - 1), | 90 | std::next(mEntries.begin(), mNumEntries - 1), | ||
91 | std::next(mEntries.begin(), mNumEntries)); | 91 | std::next(mEntries.begin(), mNumEntries)); | ||
92 | 92 | | |||
93 | // insert up front | 93 | // insert up front | ||
94 | mEntries.front() = {std::move(key), std::move(value)}; | 94 | mEntries.front() = {std::move(key), std::move(value)}; | ||
95 | } | 95 | } | ||
96 | 96 | | |||
97 | void clear() | ||||
98 | { | ||||
99 | mNumEntries = 0; | ||||
dfaure: no clearing of mEntries here? | |||||
100 | } | ||||
Oh, it's a std::array, I thought it was some sort of vector. OK then this probably isn't necessary, sorry for the wrong request. dfaure: Oh, it's a std::array, I thought it was some sort of vector.
OK then this probably isn't… | |||||
mwolff: I'll keep it to free the memory of the previously-used pixmaps | |||||
101 | | ||||
97 | private: | 102 | private: | ||
98 | Entries mEntries; | 103 | Entries mEntries; | ||
99 | std::size_t mNumEntries = 0; | 104 | std::size_t mNumEntries = 0; | ||
100 | }; | 105 | }; | ||
101 | 106 | | |||
102 | #endif | 107 | #endif |
no clearing of mEntries here?