mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
Use unique_ptr for trivial ownership (#16300)
This commit is contained in:
parent
08bc036311
commit
5b37614d23
10 changed files with 44 additions and 59 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <unordered_set>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include "metadata.h"
|
||||
|
||||
/*
|
||||
|
@ -35,7 +36,7 @@ public:
|
|||
// The inventory
|
||||
Inventory *getInventory()
|
||||
{
|
||||
return m_inventory;
|
||||
return m_inventory.get();
|
||||
}
|
||||
|
||||
inline bool isPrivate(const std::string &name) const
|
||||
|
@ -50,7 +51,7 @@ public:
|
|||
private:
|
||||
int countNonPrivate() const;
|
||||
|
||||
Inventory *m_inventory;
|
||||
std::unique_ptr<Inventory> m_inventory;
|
||||
std::unordered_set<std::string> m_privatevars;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue