Skip to content

Commit a89e6ff

Browse files
izeyephilwebb
authored andcommitted
Polish dashIgnoringElementEquals()
See gh-16671
1 parent ec72d28 commit a89e6ff

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,16 @@ else if (ch1 != ch2) {
394394
i2++;
395395
}
396396
}
397-
boolean indexed2 = e2.getType(i).isIndexed();
398-
while (i2 < l2) {
399-
char ch2 = e2.charAt(i, i2++);
400-
if (indexed2 || ch2 != '-') {
397+
if (i2 < l2) {
398+
if (e2.getType(i).isIndexed()) {
401399
return false;
402400
}
401+
do {
402+
if (e2.charAt(i, i2++) != '-') {
403+
return false;
404+
}
405+
}
406+
while (i2 < l2);
403407
}
404408
return true;
405409
}

0 commit comments

Comments
 (0)