mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-11 20:45:05 +00:00
Fixing a possible overflow in the >> 1 divide by two by using >>> 1 instead. Findbugs pointed this out>
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@636641 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7fa45f4335
commit
dcf024f3aa
@ -679,7 +679,7 @@ private int binarySearch(int key) {
|
|||||||
int high = size - 1;
|
int high = size - 1;
|
||||||
|
|
||||||
while (low <= high) {
|
while (low <= high) {
|
||||||
int mid = (low + high) >> 1;
|
int mid = (low + high) >>> 1;
|
||||||
int midVal = values[mid];
|
int midVal = values[mid];
|
||||||
|
|
||||||
if (midVal < key) {
|
if (midVal < key) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user