top | item 23678625

(no title)

cybervasi | 5 years ago

A good example of a tail recursive function. There is a bug, however:

  if (partitionFunctions.isEmpty) {
    results
  }
When the recursive function runs out of partition matching functions in the list, it returns the data that has been partitioned successfully thus far. The rest of the data that has not been matched is lost. I would suggest adding the remainder of the input to the result map using a default partition key, e.g. 'others'.

discuss

order

No comments yet.