mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8276904: Optional.toString() is unnecessarily expensive
Reviewed-by: rriggs, smarks
This commit is contained in:
parent
6e7b7f352e
commit
fe2ae8e38b
4 changed files with 4 additions and 4 deletions
|
@ -326,7 +326,7 @@ public final class OptionalInt {
|
|||
@Override
|
||||
public String toString() {
|
||||
return isPresent
|
||||
? String.format("OptionalInt[%s]", value)
|
||||
? ("OptionalInt[" + value + "]")
|
||||
: "OptionalInt.empty";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue