jojochuang commented on code in PR #5654:
URL: https://github.com/apache/ozone/pull/5654#discussion_r1402759700
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java:
##########
@@ -337,13 +342,11 @@ public static int getContainerSizeBinIndex(long
containerSize) {
return index < 29 ? 0 : index - 29;
}
- private static int nextClosestPowerIndexOfTwo(long dataSize) {
- int index = 0;
- while (dataSize != 0) {
- dataSize >>= 1;
- index += 1;
- }
- return index;
+ static int nextClosestPowerIndexOfTwo(long n) {
+ return n > 0 ? 64 - Long.numberOfLeadingZeros(n - 1)
Review Comment:
genius
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]