sheharyaar commented on issue #1212:
URL: https://github.com/apache/kvrocks/issues/1212#issuecomment-1988952298

   @jihuayu , I think of two approaches :
   
   1. We can convert the bits to bytes and when the bit position is retrieved 
we can check if it falls with [start,end) bits.
   - This would allow us not to change the semantics of `BitmapString::BitPos` 
(https://github.com/apache/kvrocks/blob/unstable/src/types/redis_bitmap_string.cc#L102-L129)
 which is called by `BitMap::BitPos` 
(https://github.com/apache/kvrocks/blob/unstable/src/types/redis_bitmap.cc#L318-L321).
   
   Before that call we can store the original start and stop and then later 
compare them with the answer, like this :
   
![image](https://github.com/apache/kvrocks/assets/34273345/b7e79ff5-b401-453e-bd4f-a49f05c7958b)
   
   2. We can change the semantics of  `BitmapString::BitPos`,  `Bitmap::BitPos` 
and 
utl::msb::RawBitPos(https://github.com/apache/kvrocks/blob/1f3913f7942e370581a6c7ca7f9c99cdb7f58479/src/common/bit_util.h#L105-L145).
 
   
   
   So which should I go with ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to