[BUG] fix extra memory copy in bitmap value (#6599)
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user