Skip to content

Commit

Permalink
MINOR: More efficient midpoint calc for AbstractIndex (apache#5378)
Browse files Browse the repository at this point in the history
Reviewers: Ismael Juma <[email protected]>
  • Loading branch information
cmccabe authored and ijuma committed Nov 16, 2019
1 parent 255fcdc commit cf84f24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/kafka/log/AbstractIndex.scala
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ abstract class AbstractIndex[K, V](@volatile var file: File, val baseOffset: Lon
var lo = begin
var hi = end
while(lo < hi) {
val mid = ceil(hi/2.0 + lo/2.0).toInt
val mid = (lo + hi) >>> 1
val found = parseEntry(idx, mid)
val compareResult = compareIndexEntry(found, target, searchEntity)
if(compareResult > 0)
Expand Down

0 comments on commit cf84f24

Please sign in to comment.