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

Side by Side Diff: components/url_matcher/string_pattern.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 unified diff | Download patch
« no previous file with comments | « components/policy/core/common/policy_namespace.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/url_matcher/string_pattern.h" 5 #include "components/url_matcher/string_pattern.h"
6 6
7 #include <tuple>
8
9 namespace url_matcher { 7 namespace url_matcher {
10 8
11 StringPattern::StringPattern(const std::string& pattern, 9 StringPattern::StringPattern(const std::string& pattern,
12 StringPattern::ID id) 10 StringPattern::ID id)
13 : pattern_(pattern), id_(id) {} 11 : pattern_(pattern), id_(id) {}
14 12
15 StringPattern::~StringPattern() {} 13 StringPattern::~StringPattern() {}
16 14
17 bool StringPattern::operator<(const StringPattern& rhs) const { 15 bool StringPattern::operator<(const StringPattern& rhs) const {
18 return std::tie(id_, pattern_) < std::tie(rhs.id_, rhs.pattern_); 16 if (id_ != rhs.id_) return id_ < rhs.id_;
17 return pattern_ < rhs.pattern_;
19 } 18 }
20 19
21 } // namespace url_matcher 20 } // namespace url_matcher
OLDNEW
« no previous file with comments | « components/policy/core/common/policy_namespace.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698