Skip to content

Conversation

@alexander-yakushev
Copy link
Contributor

Computing a child-transformer in a single reduce achieves several benefits:

  1. No need to accumulate intermediate child transformers into a vector.
  2. No need to reverse the vector direction - calling -comp on the next child and the accumulator achieves that naturally.
  3. For the very common case where there is just one child, the vector overhead is gone completely.

Co-authored-by: Ambrose Bonnaire-Sergeant <[email protected]>
@alexander-yakushev
Copy link
Contributor Author

@frenchy64 Yeah, that was my initial version, but then I decided to codegolf one line off. I've commited your suggestion.

@mattiuusitalo mattiuusitalo merged commit c5b8b21 into metosin:master Nov 14, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants