Replace string arguments with char
Optimize method calls by replacing single character String arguments with char. Closes gh-11680
This commit is contained in:
committed by
Phillip Webb
parent
2735f57b0d
commit
b19dcb13e2
@@ -78,7 +78,7 @@ final class SpringBootConfigurationFinder {
|
||||
}
|
||||
|
||||
private String getParentPackage(String sourcePackage) {
|
||||
int lastDot = sourcePackage.lastIndexOf(".");
|
||||
int lastDot = sourcePackage.lastIndexOf('.');
|
||||
return (lastDot == -1 ? "" : sourcePackage.substring(0, lastDot));
|
||||
}
|
||||
|
||||
|
||||
@@ -91,8 +91,8 @@ public abstract class EnvironmentTestUtils {
|
||||
}
|
||||
|
||||
private static int getSeparatorIndex(String pair) {
|
||||
int colonIndex = pair.indexOf(":");
|
||||
int equalIndex = pair.indexOf("=");
|
||||
int colonIndex = pair.indexOf(':');
|
||||
int equalIndex = pair.indexOf('=');
|
||||
if (colonIndex == -1) {
|
||||
return equalIndex;
|
||||
}
|
||||
|
||||
@@ -267,8 +267,8 @@ public final class TestPropertyValues {
|
||||
}
|
||||
|
||||
private static int getSeparatorIndex(String pair) {
|
||||
int colonIndex = pair.indexOf(":");
|
||||
int equalIndex = pair.indexOf("=");
|
||||
int colonIndex = pair.indexOf(':');
|
||||
int equalIndex = pair.indexOf('=');
|
||||
if (colonIndex == -1) {
|
||||
return equalIndex;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user