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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      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

            • Assignee:
              uschindler Uwe Schindler
              Reporter:
              uschindler Uwe Schindler

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment