Skip to content

Commit

Permalink
Removed the if-else and replaced with clearer data flow. (#1311)
Browse files Browse the repository at this point in the history
Co-authored-by: ghost <uv993mkf9e@protonmail.com>
  • Loading branch information
mosbat and ghost authored Nov 13, 2024
1 parent 2a37866 commit 267242e
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 267242e

Please sign in to comment.