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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user