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

perf: optimize code performance #148

Merged
merged 1 commit into from
Mar 26, 2023
Merged

Conversation

kirklin
Copy link
Contributor

@kirklin kirklin commented Mar 26, 2023

Changes

  • Optimize the code performance by using more efficient functions.

Details

  • Use splice method in remove function to remove an element from an array instead of creating a new one.
  • Use slice method in exclude function to make a shallow copy of the original array instead of modifying it directly.
  • Use which.sync method in cmdExists function to check if a command exists instead of creating a child process and executing a command.

Reason for Change

The original code had some performance issues due to the use of inefficient functions. By optimizing the code, we can improve its performance and make it more efficient.

@antfu antfu merged commit 4cd9e65 into antfu-collective:main Mar 26, 2023
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