Skip to content

feat: add Array.mapRange#7603

Open
ElectricalBoy wants to merge 4 commits into
mainfrom
maprange
Open

feat: add Array.mapRange#7603
ElectricalBoy wants to merge 4 commits into
mainfrom
maprange

Conversation

@ElectricalBoy
Copy link
Copy Markdown
Collaborator

Summary

We use Array.range as an argument to Array.map (i.e., Array.map(Array.range(from, to), funct)) quite frequently (207 uses). Each of these calls creates an intermediate integer[] that is used nowhere else.
To optimize such calls, this PR introduces Array.mapRange and updates existing uses in Commons to use mapRange.

How did you test this change?

included test

@ElectricalBoy ElectricalBoy requested a review from a team as a code owner June 4, 2026 02:36
@ElectricalBoy ElectricalBoy requested a review from a team as a code owner June 4, 2026 02:36
Copy link
Copy Markdown
Collaborator

@mbergen mbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably won't do a lot when it comes to memory peaks, but sure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants