diff options
author | Determinant <ted.sybil@gmail.com> | 2019-06-26 19:13:43 -0400 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2019-06-26 19:13:43 -0400 |
commit | 85552ce1b0bc997f58341f21ab8bbcf7d937ab4b (patch) | |
tree | f1f58dbfcb4f485d97781a011785e3e031fd499f /include/salticidae/stream.h | |
parent | 051fb69b7e1bd321e4c780e35f92ea93828b520f (diff) |
change to new (more flexible) p2p design
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 { |