OLD | NEW |
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 |
7 namespace url_matcher { | 9 namespace url_matcher { |
8 | 10 |
9 StringPattern::StringPattern(const std::string& pattern, | 11 StringPattern::StringPattern(const std::string& pattern, |
10 StringPattern::ID id) | 12 StringPattern::ID id) |
11 : pattern_(pattern), id_(id) {} | 13 : pattern_(pattern), id_(id) {} |
12 | 14 |
13 StringPattern::~StringPattern() {} | 15 StringPattern::~StringPattern() {} |
14 | 16 |
15 bool StringPattern::operator<(const StringPattern& rhs) const { | 17 bool StringPattern::operator<(const StringPattern& rhs) const { |
16 if (id_ != rhs.id_) return id_ < rhs.id_; | 18 return std::tie(id_, pattern_) < std::tie(rhs.id_, rhs.pattern_); |
17 return pattern_ < rhs.pattern_; | |
18 } | 19 } |
19 | 20 |
20 } // namespace url_matcher | 21 } // namespace url_matcher |
OLD | NEW |