-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
#143: Support: Byte Array DataType and Operations #180
#143: Support: Byte Array DataType and Operations #180
Conversation
@yashs360, need your help here. I am in a dilemma. Given Redis is in C, strings are essentially bytes. In Go, strings are strings and any byte level operation becomes costly. What do you think? FYI @JyotinderSingh |
Hey @arpitbbhayani / @JyotinderSingh / @yashs360 I have added support for:
Doubts:
So while doing SETBIT K 23 0, should we free up the memory, they are doing in Redis -> Code Reference: This |
I think its fine as long as we document it. We should be able to diverge from redis as long as we have the capability covered by a the byte commands, and fail for divergence scenarios. |
Okay @yashs360 , I will try to add in the comments itself and also will throw different error if any bit operations are done on strings 👍🏾 |
core/bytearray.go
Outdated
@@ -31,6 +45,14 @@ func (b *ByteArray) GetBit(pos int) bool { | |||
return (b.data[byteIndex] & (1 << bitIndex)) != 0 | |||
} | |||
|
|||
// GetBit gets the bit at the given position |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question GetBit vs GetBitByByteArrayPosition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change @MohitVachhani . Dropped a few comments. |
Hey @yashs360 / @JyotinderSingh, Could you please let me know the next steps here ? I’m looking to complete this task. Thanks 🙇🏾 |
@MohitVachhani Overall the he change looks good, but the rewrite of Set/Get Bits doesn't make sense to me. If there are concerns with existing functions we should modify the existing code to address that instead of creating new functions. |
Sure will update the existing function and let you know soon @yashs360 |
Hey @yashs360 I have updated the code, as per the above comments. Please can you check it out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
Thanks for the review @yashs360 |
@MohitVachhani please fix the linter issues. Also added a minor comment. |
Thanks for addressing the comments and working on this large PR, merged! |
This PR addresses [Issue]
Note: