Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Unified Diff: components/policy/core/common/policy_namespace.cc

Issue 1447153002: Use std::tie() for operator< in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/policy_namespace.cc
diff --git a/components/policy/core/common/policy_namespace.cc b/components/policy/core/common/policy_namespace.cc
index 0fac9ca1e458aa076434f0e93e3795d2bd37b1ac..33a999283544d96de1895ff6734b23e49994d3b0 100644
--- a/components/policy/core/common/policy_namespace.cc
+++ b/components/policy/core/common/policy_namespace.cc
@@ -4,6 +4,8 @@
#include "components/policy/core/common/policy_namespace.h"
+#include <tuple>
+
namespace policy {
PolicyNamespace::PolicyNamespace() {}
@@ -26,8 +28,8 @@ PolicyNamespace& PolicyNamespace::operator=(const PolicyNamespace& other) {
}
bool PolicyNamespace::operator<(const PolicyNamespace& other) const {
- return domain < other.domain ||
- (domain == other.domain && component_id < other.component_id);
+ return std::tie(domain, component_id) <
+ std::tie(other.domain, other.component_id);
}
bool PolicyNamespace::operator==(const PolicyNamespace& other) const {

Powered by Google App Engine
This is Rietveld 408576698