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

Unified Diff: extensions/common/api/sockets/sockets_manifest_permission_unittest.cc

Issue 1461163002: Use std::tie() for operator< in extensions/ (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
« no previous file with comments | « extensions/browser/process_map.cc ('k') | extensions/common/permissions/socket_permission_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/api/sockets/sockets_manifest_permission_unittest.cc
diff --git a/extensions/common/api/sockets/sockets_manifest_permission_unittest.cc b/extensions/common/api/sockets/sockets_manifest_permission_unittest.cc
index ad5ba16e9aaea09c36dfa1bbbcb4ff7f76d5d42d..bccce57461311c4b74f32712da113f70b0b2f2d8 100644
--- a/extensions/common/api/sockets/sockets_manifest_permission_unittest.cc
+++ b/extensions/common/api/sockets/sockets_manifest_permission_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <set>
+#include <tuple>
#include "base/json/json_reader.h"
#include "base/pickle.h"
@@ -67,10 +68,8 @@ struct CheckFormatEntry {
// operators <, == are needed by container std::set and algorithms
// std::set_includes and std::set_differences.
bool operator<(const CheckFormatEntry& rhs) const {
- if (operation_type == rhs.operation_type)
- return host_pattern < rhs.host_pattern;
-
- return operation_type < rhs.operation_type;
+ return std::tie(operation_type, host_pattern) <
+ std::tie(rhs.operation_type, rhs.host_pattern);
}
bool operator==(const CheckFormatEntry& rhs) const {
« no previous file with comments | « extensions/browser/process_map.cc ('k') | extensions/common/permissions/socket_permission_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698