]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/db/prefix_test.cc
import 14.2.4 nautilus point release
[ceph.git] / ceph / src / rocksdb / db / prefix_test.cc
index fcd3ca252ec6bcd63b1cab12a2e0fa2ba2cd2466..ac854cb3dbd4d15880dd67f78da32d692661ad60 100644 (file)
@@ -83,7 +83,7 @@ class TestKeyComparator : public Comparator {
 
   // Compare needs to be aware of the possibility of a and/or b is
   // prefix only
-  virtual int Compare(const Slice& a, const Slice& b) const override {
+  int Compare(const Slice& a, const Slice& b) const override {
     const TestKey kkey_a = SliceToTestKey(a);
     const TestKey kkey_b = SliceToTestKey(b);
     const TestKey *key_a = &kkey_a;
@@ -122,14 +122,12 @@ class TestKeyComparator : public Comparator {
     return Compare(TestKeyToSlice(sa, a), TestKeyToSlice(sb, b)) < 0;
   }
 
-  virtual const char* Name() const override {
-    return "TestKeyComparator";
-  }
+  const char* Name() const override { return "TestKeyComparator"; }
 
-  virtual void FindShortestSeparator(std::string* /*start*/,
-                                     const Slice& /*limit*/) const override {}
+  void FindShortestSeparator(std::string* /*start*/,
+                             const Slice& /*limit*/) const override {}
 
-  virtual void FindShortSuccessor(std::string* /*key*/) const override {}
+  void FindShortSuccessor(std::string* /*key*/) const override {}
 };
 
 namespace {
@@ -195,27 +193,23 @@ class SamePrefixTransform : public SliceTransform {
   explicit SamePrefixTransform(const Slice& prefix)
       : prefix_(prefix), name_("rocksdb.SamePrefix." + prefix.ToString()) {}
 
-  virtual const char* Name() const override { return name_.c_str(); }
+  const char* Name() const override { return name_.c_str(); }
 
-  virtual Slice Transform(const Slice& src) const override {
+  Slice Transform(const Slice& src) const override {
     assert(InDomain(src));
     return prefix_;
   }
 
-  virtual bool InDomain(const Slice& src) const override {
+  bool InDomain(const Slice& src) const override {
     if (src.size() >= prefix_.size()) {
       return Slice(src.data(), prefix_.size()) == prefix_;
     }
     return false;
   }
 
-  virtual bool InRange(const Slice& dst) const override {
-    return dst == prefix_;
-  }
+  bool InRange(const Slice& dst) const override { return dst == prefix_; }
 
-  virtual bool FullLengthEnabled(size_t* /*len*/) const override {
-    return false;
-  }
+  bool FullLengthEnabled(size_t* /*len*/) const override { return false; }
 };
 
 }  // namespace
@@ -283,9 +277,8 @@ class PrefixTest : public testing::Test {
   PrefixTest() : option_config_(kBegin) {
     options.comparator = new TestKeyComparator();
   }
-  ~PrefixTest() {
-    delete options.comparator;
-  }
+  ~PrefixTest() override { delete options.comparator; }
+
  protected:
   enum OptionConfig {
     kBegin,