Simplify a null check in the private replaceEach() method. (#514)

This commit is contained in:
Isira Seneviratne 2020-04-20 20:54:33 +00:00 committed by GitHub
parent 96caf42b31
commit 0b899ee40b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -6717,8 +6717,7 @@ public class StringUtils {
// index of replace array that will replace the search string found
// NOTE: logic duplicated below START
for (int i = 0; i < searchLength; i++) {
if (noMoreMatchesForReplIndex[i] || searchList[i] == null ||
searchList[i].isEmpty() || replacementList[i] == null) {
if (noMoreMatchesForReplIndex[i] || isEmpty(searchList[i]) || replacementList[i] == null) {
continue;
}
tempIndex = text.indexOf(searchList[i]);