summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cc/quads/render_pass_id.h5
-rw-r--r--cc/surfaces/surface_sequence.h7
2 files changed, 7 insertions, 5 deletions
diff --git a/cc/quads/render_pass_id.h b/cc/quads/render_pass_id.h
index 9c36f32..f6ab9ce 100644
--- a/cc/quads/render_pass_id.h
+++ b/cc/quads/render_pass_id.h
@@ -5,6 +5,8 @@
#ifndef CC_QUADS_RENDER_PASS_ID_H_
#define CC_QUADS_RENDER_PASS_ID_H_
+#include <tuple>
+
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "cc/base/cc_export.h"
@@ -27,8 +29,7 @@ class CC_EXPORT RenderPassId {
}
bool operator!=(const RenderPassId& other) const { return !(*this == other); }
bool operator<(const RenderPassId& other) const {
- return layer_id < other.layer_id ||
- (layer_id == other.layer_id && index < other.index);
+ return std::tie(layer_id, index) < std::tie(other.layer_id, other.index);
}
};
diff --git a/cc/surfaces/surface_sequence.h b/cc/surfaces/surface_sequence.h
index 72f4bc9..b579296 100644
--- a/cc/surfaces/surface_sequence.h
+++ b/cc/surfaces/surface_sequence.h
@@ -5,6 +5,8 @@
#ifndef CC_SURFACES_SURFACE_SEQUENCE_H_
#define CC_SURFACES_SURFACE_SEQUENCE_H_
+#include <tuple>
+
#include "base/containers/hash_tables.h"
namespace cc {
@@ -31,9 +33,8 @@ inline bool operator!=(const SurfaceSequence& a, const SurfaceSequence& b) {
}
inline bool operator<(const SurfaceSequence& a, const SurfaceSequence& b) {
- if (a.id_namespace != b.id_namespace)
- return a.id_namespace < b.id_namespace;
- return a.sequence < b.sequence;
+ return std::tie(a.id_namespace, a.sequence) <
+ std::tie(b.id_namespace, b.sequence);
}
} // namespace cc