sstable key: provide equality and inequality operator

So we don't have to convert to a bytes view unnecessarily.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
This commit is contained in:
Glauber Costa
2015-05-05 17:41:44 -04:00
parent 936bb2c97d
commit 4dde0386de

View File

@@ -17,6 +17,9 @@ class key_view {
public:
key_view(bytes_view b) : _bytes(b) {}
bool operator==(const key_view& k) const { return k._bytes == _bytes; }
bool operator!=(const key_view& k) const { return !(k == *this); }
explicit operator bytes_view() const {
return _bytes;
}