mirror of
https://github.com/google/leveldb.git
synced 2024-12-18 09:07:47 +08:00
Fix build errors.
PiperOrigin-RevId: 351442409
This commit is contained in:
parent
8f1861462b
commit
1998c0ef15
@ -130,7 +130,7 @@ class CountComparator : public Comparator {
|
|||||||
public:
|
public:
|
||||||
CountComparator(const Comparator* wrapped) : wrapped_(wrapped) {}
|
CountComparator(const Comparator* wrapped) : wrapped_(wrapped) {}
|
||||||
~CountComparator() override {}
|
~CountComparator() override {}
|
||||||
int Compare(const Slice& a, const Slice& b) const {
|
int Compare(const Slice& a, const Slice& b) const override {
|
||||||
count_.fetch_add(1, std::memory_order_relaxed);
|
count_.fetch_add(1, std::memory_order_relaxed);
|
||||||
return wrapped_->Compare(a, b);
|
return wrapped_->Compare(a, b);
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ class CountComparator : public Comparator {
|
|||||||
void reset() { count_.store(0, std::memory_order_relaxed); }
|
void reset() { count_.store(0, std::memory_order_relaxed); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable std::atomic<size_t> count_ = 0;
|
mutable std::atomic<size_t> count_{0};
|
||||||
const Comparator* const wrapped_;
|
const Comparator* const wrapped_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user