Skip to content

Commit 0385c8b

Browse files
committed
Avoid use toString() or substring() in favor of a simplified expression.
No longer need to check length since contains() call does not need to guarded.
1 parent a606fd9 commit 0385c8b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public String encode(String input, final Languages.LanguageSet languageSet) {
403403
input = input.toLowerCase(Locale.ENGLISH).replace('-', ' ').trim();
404404

405405
if (this.nameType == NameType.GENERIC) {
406-
if (input.length() >= 2 && input.startsWith("d'")) { // check for d'
406+
if (input.startsWith("d'")) { // check for d'
407407
final String remainder = input.substring(2);
408408
final String combined = "d" + remainder;
409409
return "(" + encode(remainder) + ")-(" + encode(combined) + ")";

0 commit comments

Comments
 (0)