kvrocks
kvrocks copied to clipboard
fix integer paring error in listpack and ziplist when load RDB
When parsing listpack and ziplist when loading RDB, they don't correctly handle negetive integer. in This PR i try to fix this.
When I fix the problem, I think we can make the code more simpler, and I can't stop myself do those changes:
- fix int parse bug in listpack and ziplist
- reimplement the next method using a input string stream
- remove unused public method of ZipList and ListPack (Length and Next). User can't call this method because it consume the input. Next and Length is used by Entries, we should make them private.
In InputStringStream I use execption rather than StatusOr. If using StatusOr, I must wrap every stream.Read call in GET_OR_RET, this make code hard to read.
By using InputStringStream you can easily handle offset, you can easily read certain bytes integer and string.
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
36 Code Smells
No Coverage information
0.0% Duplication
Thanks for the bugfix
However, changing the style from Status to exception only in this submodule is so weird...
Close PR due to lack of active, free feel to reopen if the issue is still living.