Skip to content
Snippets Groups Projects
Commit 1ae28e07 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

storage: cleanup

parent 2de07374
No related branches found
No related tags found
No related merge requests found
...@@ -37,8 +37,7 @@ public: ...@@ -37,8 +37,7 @@ public:
storedValues_.emplace(expiration, std::pair<InfoHash, Value::Id>(id, value.id)); storedValues_.emplace(expiration, std::pair<InfoHash, Value::Id>(id, value.id));
} }
void erase(const InfoHash& id, const Value& value, time_point expiration) { void erase(const InfoHash& id, const Value& value, time_point expiration) {
auto size = value.size(); totalSize_ -= value.size();
totalSize_ -= size;
auto range = storedValues_.equal_range(expiration); auto range = storedValues_.equal_range(expiration);
for (auto rit = range.first; rit != range.second;) { for (auto rit = range.first; rit != range.second;) {
if (rit->second.first == id && rit->second.second == value.id) { if (rit->second.first == id && rit->second.second == value.id) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment