commit | 162af60463160e4b3a89ff698a33b67cc5f16ac7 | [log] [tgz] |
---|---|---|
author | Michael Glavassevich <mrglavas@apache.org> | Thu Dec 29 06:08:53 2011 +0000 |
committer | Michael Glavassevich <mrglavas@apache.org> | Thu Dec 29 06:08:53 2011 +0000 |
tree | 1839aabeb60bc27739f3666bd07239ce64cb1814 | |
parent | 01982f296eb8a0c939e191b3b459cc2d4fa87163 [diff] |
Fixing an averaging computation that could overflow for large values. git-svn-id: https://svn.apache.org/repos/asf/xalan/java/trunk@1225445 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/org/apache/xml/utils/NodeVector.java b/src/org/apache/xml/utils/NodeVector.java index d9338a5..ae957b4 100644 --- a/src/org/apache/xml/utils/NodeVector.java +++ b/src/org/apache/xml/utils/NodeVector.java
@@ -668,9 +668,10 @@ /* * Pick a pivot and move it out of the way */ - int pivot = a[(lo + hi) / 2]; + int mid = (lo + hi) >>> 1; + int pivot = a[mid]; - a[(lo + hi) / 2] = a[hi]; + a[mid] = a[hi]; a[hi] = pivot; while (lo < hi)