diff --git a/be/src/util/bitmap_value.h b/be/src/util/bitmap_value.h index 52f39c5bac..e3a0208207 100644 --- a/be/src/util/bitmap_value.h +++ b/be/src/util/bitmap_value.h @@ -616,7 +616,7 @@ public: if (*buf == BitmapTypeCode::BITMAP32) { Roaring read = Roaring::read(buf + 1); - result.emplaceOrInsert(0, read); + result.emplaceOrInsert(0, std::move(read)); return result; } @@ -635,9 +635,9 @@ public: buf += sizeof(uint32_t); // read map value Roaring Roaring read = Roaring::read(buf); - result.emplaceOrInsert(key, read); // forward buffer past the last Roaring Bitmap buf += read.getSizeInBytes(); + result.emplaceOrInsert(key, std::move(read)); } return result; } @@ -846,6 +846,10 @@ private: roarings.emplace(std::make_pair(key, value)); #endif } + + void emplace(const uint32_t key, Roaring&& value) { + roarings.emplace(std::make_pair(key, std::move(value))); + } }; // Forked from https://github.com/RoaringBitmap/CRoaring/blob/v0.2.60/cpp/roaring64map.hh