Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid repeated String#slice calls in stringDistance. (#1095)
The `stringDistance` function calls ```js strA.slice(0, -1) ``` and ```js strB.slice(0, -1) ``` multiple times, which is a bit of a waste of time here. JavaScript engines cannot generally eliminate the duplicated calls easily, so it's better to avoid the redundant calls altogether. This improves the chai test on the [web-tooling-benchmark](https://github.com/v8/web-tooling-benchmark) by around 8% when run with upcoming V8 6.4.
- Loading branch information