News for hackers. Stuff that matters.
Re:Separating Data with a Generic Recursive Partition Functi... by cybervasi on Monday June 29, 2020 @11:46AM (#23678625)
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'.

There are no comments on this comment yet.