PragmaTwice commented on code in PR #644:
URL: https://github.com/apache/incubator-kvrocks/pull/644#discussion_r903255268
##########
src/util.cc:
##########
@@ -538,25 +550,29 @@ std::string StringToHex(const std::string &input) {
return output;
}
+constexpr std::uint64_t ExpTo1024(size_t n) {
+ return static_cast<std::uint64_t>(1) << (10 * n);
+}
+
void BytesToHuman(char *buf, size_t size, uint64_t n) {
double d;
- if (n < 1024) {
+ if (n < ExpTo1024(1)) {
Review Comment:
It just replace `1024*1024*...*1024` to something like `1024^n`, so I don't
think it will affect readability.
> And this change is not related to theme
Agree. Maybe move it to a separate PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]