Skip to content

Commit 85053db

Browse files
authored
Remove duplicate toUpperCase() calls
1 parent 0cb19d2 commit 85053db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

java/com/google/openlocationcode/OpenLocationCode.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,12 @@ public double getEastLongitude() {
153153
* @constructor
154154
*/
155155
public OpenLocationCode(String code) throws IllegalArgumentException {
156-
if (!isValidCode(code.toUpperCase())) {
156+
String newCode = code.toUpperCase();
157+
if (!isValidCode(newCode)) {
157158
throw new IllegalArgumentException(
158159
"The provided code '" + code + "' is not a valid Open Location Code.");
159160
}
160-
this.code = code.toUpperCase();
161+
this.code = newCode;
161162
}
162163

163164
/**

0 commit comments

Comments
 (0)