mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-10 03:19:01 +00:00
Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the the check.
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ public interface HotelSummary {
|
||||
Double getAverageRating();
|
||||
|
||||
default Integer getAverageRatingRounded() {
|
||||
return getAverageRating() == null ? null : (int) Math.round(getAverageRating());
|
||||
return (getAverageRating() != null ? (int) Math.round(getAverageRating()) : null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user