diff options
Diffstat (limited to 'include/salticidae/stream.h')
-rw-r--r-- | include/salticidae/stream.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/salticidae/stream.h b/include/salticidae/stream.h index 7d1456e..dc47792 100644 --- a/include/salticidae/stream.h +++ b/include/salticidae/stream.h @@ -243,6 +243,13 @@ class Blob { return !(*this == other); } + bool operator<(const Blob<N> &other) const { + for (size_t i = _len - 1; i > 0; i--) + if (data[i] != other.data[i]) + return data[i] < other.data[i]; + return data[0] < other.data[0]; + } + size_t cheap_hash() const { return *data; } void serialize(DataStream &s) const { |