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

Unified Diff: extensions/browser/process_map.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
Index: extensions/browser/process_map.cc
diff --git a/extensions/browser/process_map.cc b/extensions/browser/process_map.cc
index 0850bc6b27986a68cbbd3ceda9674ee10cf42fb4..b3100201d011331d40fc8839a82b28b61fc92a24 100644
--- a/extensions/browser/process_map.cc
+++ b/extensions/browser/process_map.cc
@@ -4,6 +4,8 @@
#include "extensions/browser/process_map.h"
+#include <tuple>
+
#include "content/public/browser/child_process_security_policy.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/process_map_factory.h"
@@ -36,21 +38,9 @@ struct ProcessMap::Item {
}
bool operator<(const ProcessMap::Item& other) const {
- if (extension_id < other.extension_id)
- return true;
-
- if (extension_id == other.extension_id &&
- process_id < other.process_id) {
- return true;
- }
-
- if (extension_id == other.extension_id &&
- process_id == other.process_id &&
- site_instance_id < other.site_instance_id) {
- return true;
- }
-
- return false;
+ return std::tie(extension_id, process_id, site_instance_id) <
+ std::tie(other.extension_id, other.process_id,
+ other.site_instance_id);
}
std::string extension_id;
« no previous file with comments | « extensions/browser/event_router.cc ('k') | extensions/common/api/sockets/sockets_manifest_permission_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698