groovy
  1. groovy
  2. GROOVY-5182

for consistency, DGM collectEntries should have a Closure.IDENTITY variant

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.5, 2.0-beta-2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Allowing the following:

      def nums = [1, 10, 100, 1000]
      def tuples = nums.collect{ [it, it.toString().size()] }
      assert tuples == [[1, 1], [10, 2], [100, 3], [1000, 4]]
      def map = tuples.collectEntries() // <= proposed variant
      assert map == [1:1, 10:2, 100:3, 1000:4]
      

        Activity

        Paul King made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0-beta-2 [ 18072 ]
        Fix Version/s 1.8.5 [ 18071 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Paul King
            Reporter:
            Paul King
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: