Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-2990

Improve ArrayUtil/CollectionUtil.*Sort() methods to early-reaturn on empty or one-element lists/arrays

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 3.2, 4.0-ALPHA
    • None
    • None
    • New, Patch Available

    Description

      It might be a good idea to make CollectionUtil or ArrayUtil return early if the passed-in list or array's length <= 1 because sorting is unneeded then. This improves maybe automaton or other places, as for empty or one-element lists no SorterTermplate is created.

      Attachments

        1. LUCENE-2990.patch
          6 kB
          Uwe Schindler
        2. LUCENE-2990.patch
          4 kB
          Uwe Schindler
        3. LUCENE-2990.patch
          6 kB
          Uwe Schindler

        Issue Links

          Activity

            People

              uschindler Uwe Schindler
              uschindler Uwe Schindler
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: