Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Replace map with forEach when possible #962

Merged
merged 1 commit into from May 12, 2022
Merged

Conversation

samestep
Copy link
Collaborator

@samestep samestep commented May 12, 2022

Description

This PR replaces map with forEach whenever the returned array is ignored. See also: https://dev.to/smeijer/stop-mutating-in-map-reduce-and-foreach-58bf

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new ESLint warnings
  • I have reviewed any generated changes to the diagrams/ folder

Open questions

  • Is there a way to lint this automatically for the future?

@samestep samestep requested a review from wodeni May 12, 2022 19:42
@cloudflare-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4984a1f
Status: ✅  Deploy successful!
Preview URL: https://836ea79f.penrose-panes.pages.dev

View logs

@codecov
Copy link

codecov bot commented May 12, 2022

Codecov Report

Merging #962 (4984a1f) into main (f714bbe) will not change coverage.
The diff coverage is 88.88%.

@@           Coverage Diff           @@
##             main     #962   +/-   ##
=======================================
  Coverage   63.03%   63.03%           
=======================================
  Files          62       62           
  Lines        7947     7947           
  Branches     1851     1851           
=======================================
  Hits         5009     5009           
  Misses       2814     2814           
  Partials      124      124           
Impacted Files Coverage Δ
packages/core/src/contrib/Functions.ts 13.71% <75.00%> (ø)
packages/core/src/compiler/Domain.ts 86.22% <100.00%> (ø)
packages/core/src/compiler/Style.ts 78.83% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f714bbe...4984a1f. Read the comment docs.

@samestep samestep merged commit 37f784a into main May 12, 2022
@samestep samestep deleted the map-foreach branch May 12, 2022 19:54
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.

None yet

2 participants