diff options
author | Spencer T Brody <spencer@10gen.com> | 2012-10-25 19:16:56 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2012-10-26 15:15:59 -0400 |
commit | 2ef1d63cc5a5a8c05aed7204e867ffa99f03827d (patch) | |
tree | d9a3094a30dcce49af09955890c422082f0b2e8c | |
parent | 99418fac8dcb69a99faf9cc7a0b322e8ffd70fe5 (diff) | |
download | mongo-2ef1d63cc5a5a8c05aed7204e867ffa99f03827d.tar.gz |
SERVER-7126 Use std::bitset in ActionSet instead of uint64_t
-rw-r--r-- | src/mongo/db/auth/action_set.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/auth/action_set.h | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/auth/action_set.cpp b/src/mongo/db/auth/action_set.cpp index ee544ddcf4e..7c37cb258d5 100644 --- a/src/mongo/db/auth/action_set.cpp +++ b/src/mongo/db/auth/action_set.cpp @@ -18,6 +18,7 @@ #include "mongo/db/auth/action_set.h" +#include <bitset> #include <string> #include "mongo/base/status.h" @@ -28,11 +29,11 @@ namespace mongo { void ActionSet::addAction(const ActionType& action) { - _actions |= (1ULL << action.getIdentifier()); + _actions.set(action.getIdentifier(), true); } bool ActionSet::contains(const ActionType& action) const { - return _actions & (1ULL << action.getIdentifier()); + return _actions[action.getIdentifier()]; } bool ActionSet::isSupersetOf(const ActionSet& other) const { diff --git a/src/mongo/db/auth/action_set.h b/src/mongo/db/auth/action_set.h index bdd197bb4ba..f73a8161e68 100644 --- a/src/mongo/db/auth/action_set.h +++ b/src/mongo/db/auth/action_set.h @@ -16,9 +16,10 @@ #pragma once +#include <bitset> + #include "mongo/base/status.h" #include "mongo/db/auth/action_type.h" -#include "mongo/platform/cstdint.h" namespace mongo { @@ -48,7 +49,7 @@ namespace mongo { private: - uint64_t _actions; // bitmask of actions this capability grants + std::bitset<128> _actions; // bitmask of actions this capability grants }; } // namespace mongo |