diff options
author | Vitaly Buka <vitalybuka@google.com> | 2016-02-24 11:45:20 -0800 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2016-02-24 21:55:08 +0000 |
commit | b7e099618f1cd94939a240a717c0c82865839851 (patch) | |
tree | d1e4869522971c06677fa66dda4e983b7eae2ab8 /src/access_revocation_manager_impl.h | |
parent | 497559b50611b5e61242d5aca44a3572042bc6c5 (diff) | |
download | libweave-b7e099618f1cd94939a240a717c0c82865839851.tar.gz |
Simplify few comparison helpers
Change-Id: Id2ec35da6579c81d193663353d40872a9bebda38
Reviewed-on: https://weave-review.googlesource.com/2736
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
Diffstat (limited to 'src/access_revocation_manager_impl.h')
-rw-r--r-- | src/access_revocation_manager_impl.h | 9 |
1 files changed, 4 insertions, 5 deletions
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); } }; |