commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1553931 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/CodePointTranslator.java
Date Sat, 28 Dec 2013 21:24:44 GMT
Author: ggregory
Date: Sat Dec 28 21:24:44 2013
New Revision: 1553931

URL: http://svn.apache.org/r1553931
Log:
No need for if/then/else w/ 2 returns when a simple ternary expression will do.

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/CodePointTranslator.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/CodePointTranslator.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/CodePointTranslator.java?rev=1553931&r1=1553930&r2=1553931&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/CodePointTranslator.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/CodePointTranslator.java
Sat Dec 28 21:24:44 2013
@@ -36,11 +36,7 @@ public abstract class CodePointTranslato
     public final int translate(final CharSequence input, final int index, final Writer out)
throws IOException {
         final int codepoint = Character.codePointAt(input, index);
         final boolean consumed = translate(codepoint, out);
-        if (consumed) {
-            return 1;
-        } else {
-            return 0;
-        }
+        return consumed ? 1 : 0; 
     }
 
     /**



Mime
View raw message