diff options
| author | Jude Melton-Houghton <jwmhjwmh@gmail.com> | 2022-09-26 17:03:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-26 17:03:43 -0400 |
| commit | f4a01f3a5dc0d8fe2f4f6d804d790da91d1bc30c (patch) | |
| tree | 089ddc309e22ae8549ec3b86765ee272f57a33df /src/client | |
| parent | 03428d9825cfdf2cfaed6ac9410dafccac0d4f3a (diff) | |
| download | minetest-f4a01f3a5dc0d8fe2f4f6d804d790da91d1bc30c.tar.xz | |
Avoid duplication of mod metadata in memory (#12562)
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/client.cpp | 20 | ||||
| -rw-r--r-- | src/client/client.h | 4 |
2 files changed, 0 insertions, 24 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp index 35634e77b..a0e867ae4 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -1991,26 +1991,6 @@ const std::string* Client::getModFile(std::string filename) return &it->second; } -bool Client::registerModStorage(ModMetadata *storage) -{ - if (m_mod_storages.find(storage->getModName()) != m_mod_storages.end()) { - errorstream << "Unable to register same mod storage twice. Storage name: " - << storage->getModName() << std::endl; - return false; - } - - m_mod_storages[storage->getModName()] = storage; - return true; -} - -void Client::unregisterModStorage(const std::string &name) -{ - std::unordered_map<std::string, ModMetadata *>::const_iterator it = - m_mod_storages.find(name); - if (it != m_mod_storages.end()) - m_mod_storages.erase(name); -} - /* * Mod channels */ diff --git a/src/client/client.h b/src/client/client.h index bdcc2a3dd..4342a0087 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -383,9 +383,6 @@ public: const std::string* getModFile(std::string filename); ModMetadataDatabase *getModStorageDatabase() override { return m_mod_storage_database; } - bool registerModStorage(ModMetadata *meta) override; - void unregisterModStorage(const std::string &name) override; - // Migrates away old files-based mod storage if necessary void migrateModStorage(); @@ -593,7 +590,6 @@ private: // Client modding ClientScripting *m_script = nullptr; - std::unordered_map<std::string, ModMetadata *> m_mod_storages; ModMetadataDatabase *m_mod_storage_database = nullptr; float m_mod_storage_save_timer = 10.0f; std::vector<ModSpec> m_mods; |
