Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitmap: Extract common bit operations like GetBit and SetBitTo #2105

Merged
merged 5 commits into from
Feb 19, 2024

Conversation

mapleFU
Copy link
Member

@mapleFU mapleFU commented Feb 18, 2024

This is a refactor, see: #2076

Previously, adhoc bit operations are used. This patch extract GetBit and SetBitTo operation to simplify the impl.

Also, because the LSB/MSB format we're using it different in BitmapString and Bitmap( see apache/kvrocks-website#198 ), lsb and msb is extracted to prevent from mistakes.

@@ -0,0 +1,148 @@
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep consistence with other files, could you rename this file to bit_util.h?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mapleFU
Copy link
Member Author

mapleFU commented Feb 18, 2024

@PragmaTwice @git-hulk

Copy link

@PragmaTwice PragmaTwice merged commit fb7acf6 into apache:unstable Feb 19, 2024
30 checks passed
@mapleFU mapleFU deleted the extract-common-bit-operations branch February 19, 2024 09:22
JoverZhang pushed a commit to JoverZhang/kvrocks that referenced this pull request Feb 24, 2024
…e#2105)

This is a refactor, see: apache#2076

Previously, adhoc bit operations are used. This patch extract `GetBit` and `SetBitTo` operation to simplify the impl.

Also, because the LSB/MSB format we're using it different in BitmapString and Bitmap( see apache/kvrocks-website#198 ), `lsb` and `msb` is extracted to prevent from mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants