RFE: Optimize j.u.Collections

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 8
    • Component/s: core-libs

      A DESCRIPTION OF THE REQUEST :
      The j.u.Collections.sort() methods always iterate over the array returned by list.toArray(). It would be nicer to check, whether the array has at least 2 elements.

      JUSTIFICATION :
      Insert the line
              if (list.size() < 2) return;
      as the first line of both j.u.Collections.sort() methods or
              if (a.length < 2) return;
      after the toArray() call.

            Assignee:
            Stuart Marks
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: