-
Notifications
You must be signed in to change notification settings - Fork 83
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
Fix various bugs in DiscordBitSet
#772
Conversation
please tell me if you happen to find any other bugs or if you think my fixes still include bugs |
Don't know enough about this to review this properly |
The re-write is perfectly fine much easier to read as well. |
yeah but since the implementation uses a |
You are right, let's just keep it long then |
* WIDTH was defined to the width of a Byte not a Long, resulting in bugs in size, get and set * binary just did some completely wrong things that I can't really describe * hashCode could return different values for equal DiscordBitSets (when they had different amounts of trailing zeros in the data array), breaking its general contract * equals was comparing this with this and not this with other, which resulted in any two DiscordBitSets considered equal * contains would erroneously return false if other did have more trailing zeros but would otherwise be contained * set wasn't growing data correctly and also didn't unset bits properly
d6b5019
to
8cddb91
Compare
did some last small changes, see here |
They look good, if there's nothing else you want to do on this PR we can merge |
i'm done here 👍 |
WIDTH
was defined to the width of aByte
not aLong
, resulting in bugs insize
,get
andset
binary
just did some completely wrong things that I can't really describehashCode
could return different values for equalDiscordBitSet
s (when they had different amounts of trailing zeros in thedata
array), breaking its general contractequals
was comparingthis
withthis
and notthis
withother
, which resulted in any twoDiscordBitSets
considered equalcontains
would erroneously returnfalse
ifother
did have more trailing zeros but would otherwise be containedset
wasn't growingdata
correctly and also didn't unset bits properly