summaryrefslogtreecommitdiff
path: root/o3tl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-05-02 10:52:50 +0200
committerLuboš Luňák <l.lunak@collabora.com>2022-05-03 06:54:54 +0200
commit0cc8da4c091ac5784c0b4c2c7850ca8dabffea04 (patch)
tree4265062fb53c4416b34e5c89a295d41e0e7187f9 /o3tl
parent1661a3ee77d78807f287146f8190d02d89963fe2 (diff)
remove the o3tl::lru_map "unlimited" hack
It didn't quite make sense before that maxsize == 0 meant no cleanup, and now with items optionally being count as having size more than 1 it makes even less sense to limit the size to max_size() of the containers. This comes from 16a338e173083954a9932a3a4005f17230, so instead make that special caller pass a large size, which in practice is the same. Change-Id: Id875862126200ba889211f6e4079ae5921f27650 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133690 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'o3tl')
-rw-r--r--o3tl/qa/test-lru_map.cxx20
1 files changed, 0 insertions, 20 deletions
diff --git a/o3tl/qa/test-lru_map.cxx b/o3tl/qa/test-lru_map.cxx
index edc9d7e1bf98..c99a803b3163 100644
--- a/o3tl/qa/test-lru_map.cxx
+++ b/o3tl/qa/test-lru_map.cxx
@@ -27,7 +27,6 @@ public:
void testLruRemoval();
void testCustomHash();
void testRemoveIf();
- void testNoAutoCleanup();
void testChangeMaxSize();
void testCustomItemSize();
@@ -38,7 +37,6 @@ public:
CPPUNIT_TEST(testLruRemoval);
CPPUNIT_TEST(testCustomHash);
CPPUNIT_TEST(testRemoveIf);
- CPPUNIT_TEST(testNoAutoCleanup);
CPPUNIT_TEST(testChangeMaxSize);
CPPUNIT_TEST(testCustomItemSize);
CPPUNIT_TEST_SUITE_END();
@@ -295,24 +293,6 @@ void lru_map_test::testRemoveIf()
CPPUNIT_ASSERT_EQUAL(size_t(0), lru.size());
}
-void lru_map_test::testNoAutoCleanup()
-{
- o3tl::lru_map<int, int> lru(0);
- CPPUNIT_ASSERT_EQUAL(size_t(0), lru.size());
- lru.insert({ 0, 0 });
- lru.insert({ 1, 1 });
- CPPUNIT_ASSERT_EQUAL(size_t(2), lru.size());
- lru.insert({ 0, 0 });
- CPPUNIT_ASSERT_EQUAL(size_t(2), lru.size());
-
- int i = 0;
- for (auto& rPair : lru)
- {
- CPPUNIT_ASSERT_EQUAL(i, rPair.first);
- ++i;
- }
-}
-
void lru_map_test::testChangeMaxSize()
{
o3tl::lru_map<int, int> lru(3);