< prev index next >

## src/java.desktop/share/classes/javax/swing/DefaultRowSorter.java

Print this page

    *** 1031,1042 ****
          private boolean shouldOptimizeChange(int firstRow, int lastRow) {
              if (!isTransformed()) {
                  // Not transformed, nothing to do.
                  return false;
              }
    !         if (!sorted || (lastRow - firstRow) > viewToModel.length / 10) {
    !             // We either weren't sorted, or to much changed, sort it all
                  sort();
                  return false;
              }
              return true;
          }
    --- 1031,1044 ----
          private boolean shouldOptimizeChange(int firstRow, int lastRow) {
              if (!isTransformed()) {
                  // Not transformed, nothing to do.
                  return false;
              }
    !         if (!sorted || viewToModel.length == 0 ||
    !                 (lastRow - firstRow) > viewToModel.length / 10) {
    !             // We either weren't sorted, or to much changed, sort it all or
    !             // this is the first row added and we have to update diffeent caches
                  sort();
                  return false;
              }
              return true;
          }

< prev index next >