Closed MohitVachhani closed 1 month ago
@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.
I was thinking that we diverge from Redis here and offer bit operations on only ByteArray
type that you introduced and raise error in case someone is doing it on other data type.
What do you think?
FYI @JyotinderSingh
Hey @arpitbbhayani / @JyotinderSingh / @yashs360
I have added support for:
Doubts:
ByteArray:
SETBIT k 7 1
SETBIT K 23 1
SETBIT K 23 0
So while doing SETBIT K 23 0, should we free up the memory, they are doing in Redis -> Code Reference: This
@arpitbbhayani @MohitVachhani
offer bit operations on only ByteArray
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 šš¾
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. Could you please look at that.
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. Thanks šš¾
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: