summaryrefslogtreecommitdiffstats
path: root/components/url_matcher
diff options
context:
space:
mode:
authorjsbell <jsbell@chromium.org>2015-11-20 11:07:39 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-20 19:08:34 +0000
commitdd1a3ea18cc2301d7d6a6a7b5058216b4883bd3a (patch)
treecd6f6b90430f2a3b88399815ccb61dee3e2c4040 /components/url_matcher
parentf440aa1a1e31c13ffc981612f50f330e944e2bb4 (diff)
downloadchromium_src-dd1a3ea18cc2301d7d6a6a7b5058216b4883bd3a.zip
chromium_src-dd1a3ea18cc2301d7d6a6a7b5058216b4883bd3a.tar.gz
chromium_src-dd1a3ea18cc2301d7d6a6a7b5058216b4883bd3a.tar.bz2
Reland of Use std::tie() for operator< in components/ (patchset #1 id:1 of https://codereview.chromium.org/1456263005/ )
Reason for revert: Did not resolve perf regression, so re-landing. Original issue's description: > Revert of Use std::tie() for operator< in components/ (patchset #1 id:1 of https://codereview.chromium.org/1447153002/ ) > > Reason for revert: > Perf regression? Shouldn't be, but let's check. https://crbug.com/558616 > > Original issue's description: > > Use std::tie() for operator< in components/ > > > > Simplify the code for operator< when comparing multiple members using > > a common std::tie idiom. > > > > BUG=555171 > > R=thakis@chromium.org,vabr@chromium.org,jochen@chromium.org > > > > Committed: https://crrev.com/4afb256b17b1c9a716a031205f48f4648768c308 > > Cr-Commit-Position: refs/heads/master@{#360367} > > TBR=jochen@chromium.org,thakis@chromium.org,vabr@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=555171 > > Committed: https://crrev.com/0a0c449a5af92bdca0e37d539617e9d4dffae220 > Cr-Commit-Position: refs/heads/master@{#360707} TBR=jochen@chromium.org,thakis@chromium.org,vabr@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=555171 Review URL: https://codereview.chromium.org/1459973005 Cr-Commit-Position: refs/heads/master@{#360868}
Diffstat (limited to 'components/url_matcher')
-rw-r--r--components/url_matcher/string_pattern.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/url_matcher/string_pattern.cc b/components/url_matcher/string_pattern.cc
index d103bce..a4b87bc 100644
--- a/components/url_matcher/string_pattern.cc
+++ b/components/url_matcher/string_pattern.cc
@@ -4,6 +4,8 @@
#include "components/url_matcher/string_pattern.h"
+#include <tuple>
+
namespace url_matcher {
StringPattern::StringPattern(const std::string& pattern,
@@ -13,8 +15,7 @@ StringPattern::StringPattern(const std::string& pattern,
StringPattern::~StringPattern() {}
bool StringPattern::operator<(const StringPattern& rhs) const {
- if (id_ != rhs.id_) return id_ < rhs.id_;
- return pattern_ < rhs.pattern_;
+ return std::tie(id_, pattern_) < std::tie(rhs.id_, rhs.pattern_);
}
} // namespace url_matcher