-
-
Notifications
You must be signed in to change notification settings - Fork 719
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maintenance] performance
forEach
on range
- `forEach` function [Performs the given operation on each element of this Iterator.](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/for-each.html). - `for` loop [A for loop over a range or an array is compiled to an index-based loop that does not create an iterator object.](https://kotlinlang.org/docs/control-flow.html#for-loops) First one will create `Iterator` object, second will not. It was used like that only in tests. But gaining slightly faster tests is good in my opinion.
- Loading branch information
1 parent
2eb9163
commit ba22296
Showing
3 changed files
with
16 additions
and
6 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
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
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