summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-04-17 13:47:25 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-04-17 13:47:25 +0100
commit0af3b40c28d71cc4daacb17d58509a832a4f1cc3 (patch)
treeec3cc65591aeec228c740b9e7c40050c2ba6403c
parentSimplified constexpr operations map (diff)
downloadnetfs-0af3b40c28d71cc4daacb17d58509a832a4f1cc3.tar.bz2
netfs-0af3b40c28d71cc4daacb17d58509a832a4f1cc3.tar.xz
netfs-0af3b40c28d71cc4daacb17d58509a832a4f1cc3.zip
Prevent passing null user resolver due to premature move
-rw-r--r--netfs/lib/baseMapper.cpp2
-rw-r--r--netfs/lib/baseMapper.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/netfs/lib/baseMapper.cpp b/netfs/lib/baseMapper.cpp
index c3518e4..4c2b3f0 100644
--- a/netfs/lib/baseMapper.cpp
+++ b/netfs/lib/baseMapper.cpp
@@ -4,7 +4,7 @@
namespace NetFS::Mapping {
BaseMapper::BaseMapper() : BaseMapper(std::make_shared<UserEntCache>()) { }
- BaseMapper::BaseMapper(EntryResolverPtr<User> u) : BaseMapper(std::move(u), std::make_shared<GroupEntCache>(u)) { }
+ BaseMapper::BaseMapper(const EntryResolverPtr<User> & u) : BaseMapper(u, std::make_shared<GroupEntCache>(u)) { }
BaseMapper::BaseMapper(EntryResolverPtr<User> u, EntryResolverPtr<Group> g) :
users(std::move(u)), groups(std::move(g))
diff --git a/netfs/lib/baseMapper.h b/netfs/lib/baseMapper.h
index c3bd46e..89adf5f 100644
--- a/netfs/lib/baseMapper.h
+++ b/netfs/lib/baseMapper.h
@@ -10,7 +10,7 @@ namespace NetFS {
class BaseMapper {
public:
BaseMapper();
- BaseMapper(EntryResolverPtr<User> users);
+ BaseMapper(const EntryResolverPtr<User> & users);
BaseMapper(EntryResolverPtr<User> users, EntryResolverPtr<Group> groups);
protected: