(coll) Optimize AbstractCollection.toArray()

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: 6
    • Component/s: core-libs

      AbstractCollection.toArray calls hasNext() and next() in a loop,
      but the hasNext() calls are unnecessary since the number of elements is known
      ahead of time, since size() has already been called.

      We should provide the same optimization already used in toArray(T[]).

            Assignee:
            Martin Buchholz
            Reporter:
            Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: