Skip to content

Commit

Permalink
Replace streams with for loop in customizers handling (#1274)
Browse files Browse the repository at this point in the history
This isn't going to make any difference in real life,
but it does at least make stacktraces look
a little better to look at
(when an exception is thrown or in a flamegraph)

Theoretically this change does change the semantics slightly
as the customizers array is now sorted, but these customizers
are private, so it shouldn't matter
  • Loading branch information
geoand authored Dec 20, 2024
1 parent f49a590 commit 220be74
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,15 @@ public SmallRyeConfig build() {
}
}

customizers.stream()
.sorted(Comparator.comparingInt(SmallRyeConfigBuilderCustomizer::priority))
.forEach(customizer -> customizer.configBuilder(SmallRyeConfigBuilder.this));
customizers.sort(new Comparator<>() {
@Override
public int compare(SmallRyeConfigBuilderCustomizer o1, SmallRyeConfigBuilderCustomizer o2) {
return o1.priority() - o2.priority();
}
});
for (SmallRyeConfigBuilderCustomizer customizer : customizers) {
customizer.configBuilder(this);
}

return new SmallRyeConfig(this);
}
Expand Down

0 comments on commit 220be74

Please sign in to comment.