From b7e099618f1cd94939a240a717c0c82865839851 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 24 Feb 2016 11:45:20 -0800 Subject: Simplify few comparison helpers Change-Id: Id2ec35da6579c81d193663353d40872a9bebda38 Reviewed-on: https://weave-review.googlesource.com/2736 Reviewed-by: Alex Vakulenko --- src/access_revocation_manager_impl.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/access_revocation_manager_impl.h') 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); } }; -- cgit v1.2.3