Skip to content

Commit 40a63e6

Browse files
committed
Refactor API calls in lvar.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1586286 13f79535-47bb-0310-9956-ffa450edef68
1 parent d9d0eac commit 40a63e6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/org/apache/commons/codec/language/Metaphone.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ public Metaphone() {
9191
*/
9292
public String metaphone(final String txt) {
9393
boolean hard = false;
94-
if (txt == null || txt.length() == 0) {
94+
final int txtLength = txt.length();
95+
if (txt == null || txtLength == 0) {
9596
return "";
9697
}
9798
// single character is itself
98-
if (txt.length() == 1) {
99+
if (txtLength == 1) {
99100
return txt.toUpperCase(java.util.Locale.ENGLISH);
100101
}
101102

0 commit comments

Comments
 (0)