aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/cache/cache.h
diff options
context:
space:
mode:
authoryazevnul <yazevnul@yandex-team.ru>2022-02-10 16:46:46 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:46 +0300
commit8cbc307de0221f84c80c42dcbe07d40727537e2c (patch)
tree625d5a673015d1df891e051033e9fcde5c7be4e5 /library/cpp/cache/cache.h
parent30d1ef3941e0dc835be7609de5ebee66958f215a (diff)
downloadydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/cache/cache.h')
-rw-r--r--library/cpp/cache/cache.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/cache/cache.h b/library/cpp/cache/cache.h
index 6dc997076d..93bd6614db 100644
--- a/library/cpp/cache/cache.h
+++ b/library/cpp/cache/cache.h
@@ -82,7 +82,7 @@ public:
TItem* GetOldest() {
typename TListType::TIterator it = List.Begin();
- Y_ASSERT(it != List.End());
+ Y_ASSERT(it != List.End());
return &*it;
}
@@ -190,7 +190,7 @@ public:
TItem* GetLeastFrequentlyUsed() {
typename TListType::TIterator it = List.Begin();
- Y_ASSERT(it != List.End());
+ Y_ASSERT(it != List.End());
return &*it;
}
@@ -310,7 +310,7 @@ public:
TItem* GetLightest() {
FixHeap();
- Y_ASSERT(!Heap.empty());
+ Y_ASSERT(!Heap.empty());
return Heap.front();
}
@@ -319,7 +319,7 @@ public:
// Erased items are stored in Removed set
// and will be deleted on-access (using FixHeap method)
void Erase(TItem* item) {
- Y_ASSERT(Size > 0);
+ Y_ASSERT(Size > 0);
--Size;
Removed.insert(item);
@@ -460,14 +460,14 @@ public:
// note: it shouldn't touch 'value' if it returns false.
bool PickOut(const TKey& key, TValue* value) {
- Y_ASSERT(value);
+ Y_ASSERT(value);
TIndexIterator it = Index.find(TItem(key));
if (it == Index.end())
return false;
*value = it->Value;
List.Erase(const_cast<TItem*>(&*it));
Index.erase(it);
- Y_ASSERT(Index.size() == List.GetSize());
+ Y_ASSERT(Index.size() == List.GetSize());
return true;
}
@@ -492,7 +492,7 @@ public:
}
}
- Y_ASSERT(Index.size() == List.GetSize());
+ Y_ASSERT(Index.size() == List.GetSize());
return !insertedWasRemoved;
}
@@ -505,7 +505,7 @@ public:
}
Insert(key, value);
- Y_ASSERT(Index.size() == List.GetSize());
+ Y_ASSERT(Index.size() == List.GetSize());
}
void Erase(TIterator it) {
@@ -514,7 +514,7 @@ public:
TDeleter::Destroy(item->Value);
Index.erase(it.Iter);
- Y_ASSERT(Index.size() == List.GetSize());
+ Y_ASSERT(Index.size() == List.GetSize());
}
bool Empty() const {
@@ -527,7 +527,7 @@ public:
List.Erase(item);
TDeleter::Destroy(item->Value);
}
- Y_ASSERT(List.GetSize() == 0);
+ Y_ASSERT(List.GetSize() == 0);
Index.clear();
}
@@ -563,7 +563,7 @@ protected:
void EraseFromIndex(TItem* item) {
TDeleter::Destroy(item->Value);
TIterator it = FindByItem(item);
- Y_ASSERT(it != End());
+ Y_ASSERT(it != End());
Index.erase(it.Iter);
}
};