refactor: apply modernize-use-override across codebase (#442)

- Remove redundant `virtual` keyword from methods already marked `override`
- Replace `virtual ~Derived()` with `~Derived() override` for derived class destructors
- Add missing `override` on methods that override base class virtuals
This commit is contained in:
egolearner
2026-06-02 13:49:39 +08:00
committed by GitHub
parent df447a54e2
commit 3d6906ca20
56 changed files with 540 additions and 576 deletions
@@ -26,8 +26,8 @@ namespace zvec {
class InvertedRocksdbValueMerger : public rocksdb::MergeOperator {
public:
virtual bool FullMergeV2(const MergeOperationInput &merge_in,
MergeOperationOutput *merge_out) const override {
bool FullMergeV2(const MergeOperationInput &merge_in,
MergeOperationOutput *merge_out) const override {
if (merge_in.existing_value == nullptr &&
merge_in.operand_list.size() == 1) {
merge_out->new_value = std::string(merge_in.operand_list[0].data(),
@@ -75,11 +75,10 @@ class InvertedRocksdbValueMerger : public rocksdb::MergeOperator {
}
virtual bool PartialMerge(const rocksdb::Slice & /*key*/,
const rocksdb::Slice &left_operand,
const rocksdb::Slice &right_operand,
std::string *new_value,
rocksdb::Logger * /*logger*/) const override {
bool PartialMerge(const rocksdb::Slice & /*key*/,
const rocksdb::Slice &left_operand,
const rocksdb::Slice &right_operand, std::string *new_value,
rocksdb::Logger * /*logger*/) const override {
roaring_bitmap_t *bitmap{nullptr};
auto s = InvertedIndexCodec::Deserialize(left_operand.data(),
left_operand.size(), &bitmap);
@@ -56,7 +56,7 @@ class InvertedSearchResult
explicit InvertedSearchResult(roaring_bitmap_t *bitmap) : bitmap_(bitmap) {}
~InvertedSearchResult() {
~InvertedSearchResult() override {
destroy_bitmap();
}
@@ -95,13 +95,13 @@ class InvertedSearchResult
}
}
virtual ~InvertedIndexIterator() {
~InvertedIndexIterator() override {
if (iter_) {
roaring_free_uint32_iterator(iter_);
}
}
virtual idx_t doc_id() const {
idx_t doc_id() const override {
if (!iter_) {
return INVALID_DOC_ID;
}
@@ -112,17 +112,17 @@ class InvertedSearchResult
}
}
virtual float score() const {
float score() const override {
return 0.0f;
}
virtual void next() {
void next() override {
if (iter_ && iter_->has_value) {
roaring_advance_uint32_iterator(iter_);
}
}
virtual bool valid() const {
bool valid() const override {
return iter_ ? iter_->has_value : false;
}