Skip to content

Commit

Permalink
Small clean up in timer code
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Jan 5, 2025
1 parent 9ac4cd1 commit 9df5301
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public String name(String name, Meter.Type type, String unit) {
}

private String capitalize(String name) {
if (name.length() != 0 && !Character.isUpperCase(name.charAt(0))) {
if (!name.isEmpty() && !Character.isUpperCase(name.charAt(0))) {
char[] chars = name.toCharArray();
chars[0] = Character.toUpperCase(chars[0]);
return new String(chars);
Expand Down Expand Up @@ -218,8 +218,8 @@ public static Result merge(Collection<Result> results) {

for (Result it : results) {
any = it;
min = it.min < min ? it.min : min;
max = it.max > max ? it.max : max;
min = Math.min(it.min, min);
max = Math.max(it.max, max);
totTime += it.totTime;
count += it.count;
}
Expand Down

0 comments on commit 9df5301

Please sign in to comment.