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: use magicast .includes helper #268

Merged
merged 3 commits into from
Oct 30, 2023
Merged

refactor: use magicast .includes helper #268

merged 3 commits into from
Oct 30, 2023

Conversation

angelhdzdev
Copy link
Contributor

This pr replaces the for loop to check if the modules array contains the added module, with a more performant Array.includes.

"Array.includes time:" 30 "ms"
"Manual loop time:" 326 "ms"
"Array.includes time:" 27 "ms"
"Manual loop time:" 242 "ms"

If the purpose of the for loop is backward compatibility, ignore this pr.

🔥💚

This pr replaces the for loop to check if the modules array contains the module name, with a more performant `Array.includes`.

```
"Array.includes time:" 30 "ms"
"Manual loop time:" 326 "ms"
"Array.includes time:" 27 "ms"
"Manual loop time:" 242 "ms"
```

If the purpose of the for loop is backward compatibility, ignore this pr.
This pr replaces the for loop to check if the modules array contains the module name, with a more performant `Array.includes`.

```
"Array.includes time:" 30 "ms"
"Manual loop time:" 326 "ms"
"Array.includes time:" 27 "ms"
"Manual loop time:" 242 "ms"
```

If the purpose of the for loop is backward compatibility, ignore this pr.
@pi0 pi0 changed the title [perf] Update commands/module/add.ts refactor: use magicast .includes helper Oct 30, 2023
@pi0 pi0 merged commit 3097dd3 into nuxt:main Oct 30, 2023
2 checks passed
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.

2 participants