Skip to content

Commit

Permalink
Removed the if-else and replaced with clearer data flow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost committed Nov 13, 2024
1 parent 2a37866 commit 3e1be19
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/org/apache/commons/lang3/text/WordUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,12 @@ public static String initials(final String str, final char... delimiters) {
final char ch = str.charAt(i);
if (isDelimiter(ch, delimiters)) {
lastWasGap = true;
continue;
continue; // ignore ch
}
if (lastWasGap) {
buf[count++] = ch;
lastWasGap = false;
}

// ignore ch
}
return new String(buf, 0, count);
}
Expand Down

0 comments on commit 3e1be19

Please sign in to comment.