diff options
-rw-r--r-- | src/access_revocation_manager.h | 6 | ||||
-rw-r--r-- | src/access_revocation_manager_impl.h | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/access_revocation_manager.h b/src/access_revocation_manager.h index 6d5bf7b..ba2bcca 100644 --- a/src/access_revocation_manager.h +++ b/src/access_revocation_manager.h @@ -52,8 +52,10 @@ class AccessRevocationManager { inline bool operator==(const AccessRevocationManager::Entry& l, const AccessRevocationManager::Entry& r) { - return l.revocation == r.revocation && l.expiration == r.expiration && - l.user_id == r.user_id && l.app_id == r.app_id; + auto make_tuple = [](const AccessRevocationManager::Entry& e) { + return std::tie(e.revocation, e.expiration, e.user_id, e.app_id); + }; + return make_tuple(l) == make_tuple(r); } inline bool operator!=(const AccessRevocationManager::Entry& l, diff --git a/src/access_revocation_manager_impl.h b/src/access_revocation_manager_impl.h index a911128..0ee253e 100644 --- a/src/access_revocation_manager_impl.h +++ b/src/access_revocation_manager_impl.h @@ -40,11 +40,10 @@ class AccessRevocationManagerImpl : public AccessRevocationManager { struct EntryIdsLess { bool operator()(const Entry& l, const Entry& r) const { - if (l.user_id < r.user_id) - return true; - if (l.user_id > r.user_id) - return false; - return l.app_id < r.app_id; + auto make_tuple = [](const AccessRevocationManager::Entry& e) { + return std::tie(e.user_id, e.app_id); + }; + return make_tuple(l) < make_tuple(r); } }; |