-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize some iterations in BodyExtractor and BodyInserter
This commit turns some stream-based iterations back into simpler enhanced for loops. For simple use cases like these, where the stream API is merely used to map/filter + collect to a List, a for loop is more efficient. This is especially true for small collections like the ones we deal with in BodyInserters/BodyExtractors here (in the order of 50ns/op vs 5ns/op). These cases are also simple enough that they don't lose in readability after the conversion. Closes gh-30136
- Loading branch information
1 parent
4e896c8
commit 800b134
Showing
3 changed files
with
35 additions
and
32 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