From a2fb7a99938baf5582ac232ff4be4b07efc8cb6e Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Mon, 21 Oct 2024 01:10:14 +0200 Subject: [PATCH] chore(block_cache): add clang-tidy annotations for not moving rvalues --- src/reader/internal/block_cache.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/reader/internal/block_cache.cpp b/src/reader/internal/block_cache.cpp index 0fc5d9fb..8306c1a0 100644 --- a/src/reader/internal/block_cache.cpp +++ b/src/reader/internal/block_cache.cpp @@ -91,8 +91,10 @@ class lru_sequential_access_detector : public sequential_access_detector { void touch(size_t block_no) override { std::lock_guard lock(mx_); - lru_.set(block_no, block_no, true, - [this](size_t, size_t&&) { is_sequential_.reset(); }); + lru_.set( + block_no, block_no, true, + // NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved) + [this](size_t, size_t&&) { is_sequential_.reset(); }); } std::optional prefetch() const override { @@ -330,6 +332,7 @@ class block_cache_ final : public block_cache::impl { cache_.~lru_type(); new (&cache_) lru_type(max_blocks); cache_.setPruneHook( + // NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved) [this](size_t block_no, std::shared_ptr&& block) { LOG_DEBUG << "evicting block " << block_no << " from cache, decompression ratio = "