Skip to content

Switch from Array.reduce() to a standard for loop#617

Closed
DavidTPate wants to merge 1 commit intohapijs:6.1.0from
DavidTPate:replace-reduce
Closed

Switch from Array.reduce() to a standard for loop#617
DavidTPate wants to merge 1 commit intohapijs:6.1.0from
DavidTPate:replace-reduce

Conversation

@DavidTPate
Copy link
Contributor

This PR switches the usage of Array.reduce() when create a piece of URI validation with one or more custom schemes to a standard for loop to reduce the footprint of the computations.

@Marsup I did a quick search, and this was the only usage of reduce that I saw in Joi.

… using `Array.reduce()` in a critical path.
@Marsup
Copy link
Collaborator

Marsup commented Mar 26, 2015

I'd solve the other PR before piling up if I were you :)

@DavidTPate
Copy link
Contributor Author

Closing this as #619 addresses it.

@DavidTPate DavidTPate closed this Mar 27, 2015
@DavidTPate DavidTPate deleted the replace-reduce branch March 27, 2015 04:05
@Marsup Marsup added the non issue Issue is not a problem or requires changes label Mar 27, 2015
@Marsup Marsup self-assigned this Mar 27, 2015
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

non issue Issue is not a problem or requires changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants