Remove clear() method

This commit is contained in:
Bart Louwers
2023-10-04 14:00:40 +00:00
parent fa44043742
commit 655e12a5b6
3 changed files with 4 additions and 10 deletions

View File

@@ -26,8 +26,6 @@ public:
std::string get(const StringIdentity id);
void clear();
size_t size();
protected:

View File

@@ -67,14 +67,6 @@ std::string StringIndexer::get(const StringIdentity id) {
return id < identityToString.size() ? (buffer.data() + identityToString[id]) : empty;
}
void StringIndexer::clear() {
std::unique_lock<std::shared_mutex> writerLock(sharedMutex);
stringToIdentity.clear();
identityToString.clear();
buffer.clear();
}
size_t StringIndexer::size() {
std::shared_lock<std::shared_mutex> readerLock(sharedMutex);

View File

@@ -6,6 +6,10 @@
using namespace mbgl;
TEST(StringIndexer, SingletonStringIndexer) {
EXPECT_GE(stringIndexer().size(), 0);
}
TEST(StringIndexer, AddStrings) {
StringIndexer strIndexer;
EXPECT_EQ(strIndexer.size(), 0);