[cvs] / jsr166 / src / main / java / util / PriorityQueue.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/PriorityQueue.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.32, Mon Aug 25 23:47:01 2003 UTC revision 1.33, Mon Aug 25 23:50:24 2003 UTC
# Line 517  Line 517 
517      private void fixDown(int k) {      private void fixDown(int k) {
518          int j;          int j;
519          if (comparator == null) {          if (comparator == null) {
520              while ((j = k << 1) <= size && j > 0) {              while ((j = k << 1) <= size && (j > 0)) {
521                  if (j<size && ((Comparable<E>)queue[j]).compareTo((E)queue[j+1]) > 0)                  if (j<size && ((Comparable<E>)queue[j]).compareTo((E)queue[j+1]) > 0)
522                      j++; // j indexes smallest kid                      j++; // j indexes smallest kid
523                  if (((Comparable<E>)queue[k]).compareTo((E)queue[j]) <= 0)                  if (((Comparable<E>)queue[k]).compareTo((E)queue[j]) <= 0)
# Line 526  Line 526 
526                  k = j;                  k = j;
527              }              }
528          } else {          } else {
529              while ((j = k << 1) <= size && j > 0) {              while ((j = k << 1) <= size && (j > 0)) {
530                  if (j < size && comparator.compare((E)queue[j], (E)queue[j+1]) > 0)                  if (j < size && comparator.compare((E)queue[j], (E)queue[j+1]) > 0)
531                      j++; // j indexes smallest kid                      j++; // j indexes smallest kid
532                  if (comparator.compare((E)queue[k], (E)queue[j]) <= 0)                  if (comparator.compare((E)queue[k], (E)queue[j]) <= 0)

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8