Use std::tie() for operator< in content/
Simplify the code for operator< when comparing multiple members using
a common std::tie idiom.
BUG=555171
[email protected]
Review URL: https://codereview.chromium.org/1462213002
Cr-Commit-Position: refs/heads/master@{#360883}
diff --git a/content/browser/host_zoom_map_impl.h b/content/browser/host_zoom_map_impl.h
index a9b2a45..dbf166a 100644
--- a/content/browser/host_zoom_map_impl.h
+++ b/content/browser/host_zoom_map_impl.h
@@ -7,6 +7,7 @@
#include <map>
#include <string>
+#include <tuple>
#include <vector>
#include "base/compiler_specific.h"
@@ -112,9 +113,8 @@
: render_process_id(render_process_id),
render_view_id(render_view_id) {}
bool operator<(const RenderViewKey& other) const {
- return render_process_id < other.render_process_id ||
- ((render_process_id == other.render_process_id) &&
- (render_view_id < other.render_view_id));
+ return std::tie(render_process_id, render_view_id) <
+ std::tie(other.render_process_id, other.render_view_id);
}
};