NO-JIRA Fix a "Computation of average could overflow" SpotBugs warning
https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#im-computation-of-average-could-overflow-im-average-computation-could-overflow
This commit is contained in:
parent
441c950302
commit
6fc6787227
|
@ -135,7 +135,7 @@ public class PriorityCollection<T extends PriorityAware> extends AbstractCollect
|
|||
int high = current.length - 1;
|
||||
|
||||
while (low <= high) {
|
||||
int mid = (low + high) / 2;
|
||||
int mid = (low + high) >>> 1;
|
||||
PriorityHolder<T> midVal = current[mid];
|
||||
|
||||
if (midVal.getPriority() > priority)
|
||||
|
@ -203,7 +203,7 @@ public class PriorityCollection<T extends PriorityAware> extends AbstractCollect
|
|||
int high = len - 1;
|
||||
|
||||
while (low <= high) {
|
||||
int mid = (low + high) / 2;
|
||||
int mid = (low + high) >>> 1;
|
||||
PriorityHolder<T> midVal = current[mid];
|
||||
|
||||
if (midVal.getPriority() > priority)
|
||||
|
|
Loading…
Reference in New Issue