-
-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small performance boost by allocating arrays if we can
In the case of valueArray() we don't actually know the array length, but allocating an empty array and an array with a cap of 2 is identical in terms of performance, and it saves a few allocation for the common case of len>=2.
- Loading branch information
Showing
1 changed file
with
8 additions
and
11 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