Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2428

Provide a reverseEach method for arrays

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.5.2
    • groovy-jdk
    • None
    • Patch

    Description

      Since arrays have well defined ordering, it would be nice if they had a reverseEach method like List does.

      I'm providing a patch to add this behavior. In addition, it changes the implementation of List.reverseEach to use the ListIterator to iterate in reverse instead of copying the list first, which is helpful for iterating large lists in reverse efficiently.

      Attachments

        1. reverseEach.diff
          3 kB
          Mike Dillon

        Activity

          People

            paulk Paul King
            md5 Mike Dillon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: