diff options
author | jsbell <jsbell@chromium.org> | 2015-11-20 11:37:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-20 19:38:57 +0000 |
commit | 9a9ef2b842828e764ad7e120b6563025d27bdaad (patch) | |
tree | f9140076ad1fd6a8d6090158ba239a3c32dde03c /extensions/renderer | |
parent | f38d62d883828354c5f4711307c6391a00a3e8a8 (diff) | |
download | chromium_src-9a9ef2b842828e764ad7e120b6563025d27bdaad.zip chromium_src-9a9ef2b842828e764ad7e120b6563025d27bdaad.tar.gz chromium_src-9a9ef2b842828e764ad7e120b6563025d27bdaad.tar.bz2 |
Use std::tie() for operator< in extensions/
Simplify the code for operator< when comparing multiple members using
a common std::tie idiom.
BUG=555171
R=rdevlin.cronin@chromium.org
Review URL: https://codereview.chromium.org/1461163002
Cr-Commit-Position: refs/heads/master@{#360879}
Diffstat (limited to 'extensions/renderer')
-rw-r--r-- | extensions/renderer/user_script_injector.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/extensions/renderer/user_script_injector.cc b/extensions/renderer/user_script_injector.cc index 548b4d6..9885b4e 100644 --- a/extensions/renderer/user_script_injector.cc +++ b/extensions/renderer/user_script_injector.cc @@ -4,6 +4,7 @@ #include "extensions/renderer/user_script_injector.h" +#include <tuple> #include <vector> #include "base/lazy_instance.h" @@ -36,12 +37,8 @@ struct RoutingInfoKey { : routing_id(routing_id), script_id(script_id) {} bool operator<(const RoutingInfoKey& other) const { - if (routing_id != other.routing_id) - return routing_id < other.routing_id; - - if (script_id != other.script_id) - return script_id < other.script_id; - return false; // keys are equal. + return std::tie(routing_id, script_id) < + std::tie(other.routing_id, other.script_id); } }; |