-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: avoid .toLowerCase() call in Buffer#write()
Avoid a costly String#toLowerCase() call in Buffer#write() in the common case, i.e., that the string is already lowercase. Reduces the running time of the following benchmark by about 40%: for (var b = Buffer(1), i = 0; i < 25e6; ++i) b.write('x', 'ucs2'); PR-URL: #1048 Reviewed-By: Trevor Norris <[email protected]>
- Loading branch information
1 parent
bbf54a5
commit 4ddd640
Showing
1 changed file
with
29 additions
and
31 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