// 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;
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 {
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
PrefixTest() : option_config_(kBegin) {
options.comparator = new TestKeyComparator();
}
- ~PrefixTest() {
- delete options.comparator;
- }
+ ~PrefixTest() override { delete options.comparator; }
+
protected:
enum OptionConfig {
kBegin,