Skip to content

Commit

Permalink
min/max trick does not help that much, setting initial value does.
Browse files Browse the repository at this point in the history
  • Loading branch information
abeobk committed Jan 30, 2024
1 parent 1f266af commit 4d05044
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/dev/morling/onebrc/CalculateAverage_abeobk.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ final String key() {
final void add(long val) {
sum += val;
count++;
if (val >= max) {
if (val > max) {
max = val;
}
else if (val < min) {
if (val < min) {
min = val;
}
}
Expand Down

0 comments on commit 4d05044

Please sign in to comment.