From 51fc0bc698f445da701c167ddaf67aee829c41c4 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 21 Apr 2023 16:11:34 +0800 Subject: [PATCH] sstables: use default generated operator== C++20 compiler is able to generate defaulted operator== and operator!=. and the default generated operators behaves exactly the same as the ones crafted by us. so let's it do its job. Signed-off-by: Kefu Chai Closes #13614 --- sstables/key.hh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sstables/key.hh b/sstables/key.hh index 22ac34acee..3c950b040e 100644 --- a/sstables/key.hh +++ b/sstables/key.hh @@ -39,8 +39,7 @@ public: return partition_key::from_exploded_view(explode(s)); } - bool operator==(const key_view& k) const { return k._bytes == _bytes; } - bool operator!=(const key_view& k) const { return !(k == *this); } + bool operator==(const key_view& k) const = default; bool empty() const { return _bytes.empty(); }