diff --git a/src/storage/v2/indices.cpp b/src/storage/v2/indices.cpp index 52dd75e89..eab45120a 100644 --- a/src/storage/v2/indices.cpp +++ b/src/storage/v2/indices.cpp @@ -365,7 +365,7 @@ void LabelIndex::Iterable::Iterator::AdvanceUntilValid() { LabelIndex::Iterable::Iterable(utils::SkipList::Accessor index_accessor, LabelId label, View view, Transaction *transaction, Indices *indices) - : index_accessor_(index_accessor), + : index_accessor_(std::move(index_accessor)), label_(label), view_(view), transaction_(transaction), @@ -550,7 +550,7 @@ LabelPropertyIndex::Iterable::Iterable( const std::optional> &lower_bound, const std::optional> &upper_bound, View view, Transaction *transaction, Indices *indices) - : index_accessor_(index_accessor), + : index_accessor_(std::move(index_accessor)), label_(label), property_(property), lower_bound_(lower_bound), diff --git a/src/utils/skip_list.hpp b/src/utils/skip_list.hpp index 07305fb4e..414fd7e1d 100644 --- a/src/utils/skip_list.hpp +++ b/src/utils/skip_list.hpp @@ -575,16 +575,13 @@ class SkipList final { if (skiplist_ != nullptr) skiplist_->gc_.ReleaseId(id_); } - Accessor(const Accessor &other) - : skiplist_(other.skiplist_), id_(skiplist_->gc_.AllocateId()) {} + Accessor(const Accessor &) = delete; + Accessor &operator=(const Accessor &) = delete; + Accessor(Accessor &&other) noexcept : skiplist_(other.skiplist_), id_(other.id_) { other.skiplist_ = nullptr; } - Accessor &operator=(const Accessor &other) { - skiplist_ = other.skiplist_; - id_ = skiplist_->gc_.AllocateId(); - } Accessor &operator=(Accessor &&other) noexcept { skiplist_ = other.skiplist_; id_ = other.id_; @@ -716,16 +713,13 @@ class SkipList final { if (skiplist_ != nullptr) skiplist_->gc_.ReleaseId(id_); } - ConstAccessor(const ConstAccessor &other) - : skiplist_(other.skiplist_), id_(skiplist_->gc_.AllocateId()) {} + ConstAccessor(const ConstAccessor &) = delete; + ConstAccessor &operator=(const ConstAccessor &) = delete; + ConstAccessor(ConstAccessor &&other) noexcept : skiplist_(other.skiplist_), id_(other.id_) { other.skiplist_ = nullptr; } - ConstAccessor &operator=(const ConstAccessor &other) { - skiplist_ = other.skiplist_; - id_ = skiplist_->gc_.AllocateId(); - } ConstAccessor &operator=(ConstAccessor &&other) noexcept { skiplist_ = other.skiplist_; id_ = other.id_;