You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by hu...@apache.org on 2022/09/23 01:45:08 UTC
[incubator-kvrocks] branch unstable updated: Remove unnecessary Tostring (#909)
This is an automated email from the ASF dual-hosted git repository.
hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 671cab3 Remove unnecessary Tostring (#909)
671cab3 is described below
commit 671cab35bbbaf57aeb969025c3c688d8e0dd7e6b
Author: Ruixiang Tan <81...@qq.com>
AuthorDate: Fri Sep 23 09:45:03 2022 +0800
Remove unnecessary Tostring (#909)
---
src/redis_bitmap.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/redis_bitmap.cc b/src/redis_bitmap.cc
index 02b316b..1e592c1 100644
--- a/src/redis_bitmap.cc
+++ b/src/redis_bitmap.cc
@@ -549,7 +549,6 @@ bool Bitmap::GetBitFromValueAndOffset(const std::string &value, uint32_t offset)
bool Bitmap::IsEmptySegment(const Slice &segment) {
static const char zero_byte_segment[kBitmapSegmentBytes] = {0};
- std::string value = segment.ToString();
- return !memcmp(zero_byte_segment, value.c_str(), value.size());
+ return !memcmp(zero_byte_segment, segment.data(), segment.size());
}
} // namespace Redis