This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
path: refactor for performance and consistency
Improve performance by: + Modifying an existing array instead of creating a new one (this is less readable, but it's a trade-off) + Not running the same code twice (in win32.resolve and .normalize) + Not leaking the `arguments` object! + Getting the last character of a string by index, instead of with `.substr()` Improve code consistency by: + Using `[]` instead of `.charAt()` where possible + Using a function declaration instead of a var declaration Improve both by: + Using `.slice()` instead of `.substr()` + Using `.slice()` with clearer arguments + Reusing code with the trimArray() function
- Loading branch information
Showing
1 changed file
with
52 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters