Skip to content

perf(rss/atom/json): Use .forEach() instead of .map() when resulting array is unused#234

Merged
jpmonette merged 1 commit intojpmonette:masterfrom
Greenheart:fix/change-array-iteration-method
Jan 11, 2026
Merged

perf(rss/atom/json): Use .forEach() instead of .map() when resulting array is unused#234
jpmonette merged 1 commit intojpmonette:masterfrom
Greenheart:fix/change-array-iteration-method

Conversation

@Greenheart
Copy link
Copy Markdown
Contributor

Existing functionality is not changed, and tests still pass.

This improves (marginally) performance by reducing unnecessary work. More importantly though, this change makes the code slightly easier to read and maintain, by explicitly using .map() only when .forEach() is not enough. This makes the intention clearer.

Fix #233

…ing array is unused

Existing functionality is not changed, and tests still pass.

This improves performance by reducing unnecessary work.

Fix jpmonette#233
@jpmonette jpmonette merged commit 0e7456a into jpmonette:master Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: Replace .map() with .forEach() in cases where the library only iterates over arrays without using the resulting array from .map()

2 participants