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

Unified Diff: components/content_settings/core/browser/content_settings_origin_identifier_value_map.cc

Issue 1456263005: Revert of 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/content_settings/core/browser/content_settings_origin_identifier_value_map.cc
diff --git a/components/content_settings/core/browser/content_settings_origin_identifier_value_map.cc b/components/content_settings/core/browser/content_settings_origin_identifier_value_map.cc
index 0c3ab90c6d50eea6f645def974c08e78126dd524..d51e624dcacd77770fffbfe3642e18c55dd7e22c 100644
--- a/components/content_settings/core/browser/content_settings_origin_identifier_value_map.cc
+++ b/components/content_settings/core/browser/content_settings_origin_identifier_value_map.cc
@@ -3,8 +3,6 @@
// found in the LICENSE file.
#include "components/content_settings/core/browser/content_settings_origin_identifier_value_map.h"
-
-#include <tuple>
#include "base/compiler_specific.h"
#include "base/logging.h"
@@ -63,8 +61,9 @@
bool OriginIdentifierValueMap::EntryMapKey::operator<(
const OriginIdentifierValueMap::EntryMapKey& other) const {
- return std::tie(content_type, resource_identifier) <
- std::tie(other.content_type, other.resource_identifier);
+ if (content_type != other.content_type)
+ return content_type < other.content_type;
+ return (resource_identifier < other.resource_identifier);
}
OriginIdentifierValueMap::PatternPair::PatternPair(
@@ -79,8 +78,11 @@
// Note that this operator is the other way around than
// |ContentSettingsPattern::operator<|. It sorts patterns with higher
// precedence first.
- return std::tie(primary_pattern, secondary_pattern) >
- std::tie(other.primary_pattern, other.secondary_pattern);
+ if (primary_pattern > other.primary_pattern)
+ return true;
+ else if (other.primary_pattern > primary_pattern)
+ return false;
+ return (secondary_pattern > other.secondary_pattern);
}
RuleIterator* OriginIdentifierValueMap::GetRuleIterator(
« no previous file with comments | « components/autofill/core/common/password_form_fill_data.cc ('k') | components/guest_view/browser/guest_view_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698