diff options
author | Minetest-j45 <55553015+Minetest-j45@users.noreply.github.com> | 2021-08-30 15:22:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-30 15:22:40 +0100 |
commit | 7824a4956bf489b4e2cc35e0c97272eee06be6ba (patch) | |
tree | 70243765dc1743a83596f9c6eec122fb417ef92c /src/inventory.cpp | |
parent | 607add326feb44e078b843464ce4a8de09f28743 (diff) | |
parent | 35445d24f425c6291a0580b468919ca83de716fd (diff) | |
download | dragonfireclient-7824a4956bf489b4e2cc35e0c97272eee06be6ba.tar.xz |
Merge pull request #1 from EliasFleckenstein03/master
update
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 1ef9b13cd..fc1aaf371 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -965,13 +965,14 @@ InventoryList * Inventory::getList(const std::string &name) { s32 i = getListIndex(name); if(i == -1) - return NULL; + return nullptr; return m_lists[i]; } std::vector<const InventoryList*> Inventory::getLists() { std::vector<const InventoryList*> lists; + lists.reserve(m_lists.size()); for (auto list : m_lists) { lists.push_back(list); } @@ -990,11 +991,11 @@ bool Inventory::deleteList(const std::string &name) return true; } -const InventoryList * Inventory::getList(const std::string &name) const +const InventoryList *Inventory::getList(const std::string &name) const { s32 i = getListIndex(name); if(i == -1) - return NULL; + return nullptr; return m_lists[i]; } |