Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8021981

RFE: Optimize j.u.Collections

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8
    • 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.

            smarks Stuart Marks
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: