aboutsummaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-05-13 18:06:47 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-05-13 18:06:47 +0200
commitf3e741dad1311e0b4057b530386e246f921be52c (patch)
tree64581e3f0ddfa9d4740eed7b545fe3db87b8c126 /src/inventory.cpp
parent96a37aed31cfb9c131e46eda80bdbe3d2289a546 (diff)
parent69c70dd319532f7860f211f4a527a902b0386e49 (diff)
downloaddragonfireclient-f3e741dad1311e0b4057b530386e246f921be52c.tar.xz
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp7
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];
}