semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

fix: Replace map with forEach to avoid unnecessary array creation

Open mdqst opened this issue 11 months ago • 0 comments

Description

map was used instead of forEach in the code. Since map creates a new array that isn't being used, it can be misleading and is considered an anti-pattern.

I've replaced it with forEach to make the intent clearer and avoid unnecessary overhead.

Checklist

  • [x] I have performed a self-review of my code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] My changes generate no new warnings
  • [x] I have run yarn format and yarn lint without getting any errors
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes

mdqst avatar Jan 18 '25 16:01 mdqst