You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2013/06/05 05:40:00 UTC

svn commit: r1489695 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java

Author: ggregory
Date: Wed Jun  5 03:40:00 2013
New Revision: 1489695

URL: http://svn.apache.org/r1489695
Log:
Statements unnecessarily nested within else clause.

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1489695&r1=1489694&r2=1489695&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Wed Jun  5 03:40:00 2013
@@ -5058,11 +5058,10 @@ public class StringUtils {
     public static String repeat(final String str, final String separator, final int repeat) {
         if(str == null || separator == null) {
             return repeat(str, repeat);
-        } else {
-            // given that repeat(String, int) is quite optimized, better to rely on it than try and splice this into it
-            final String result = repeat(str + separator, repeat);
-            return removeEnd(result, separator);
         }
+        // given that repeat(String, int) is quite optimized, better to rely on it than try and splice this into it
+        final String result = repeat(str + separator, repeat);
+        return removeEnd(result, separator);
     }
 
     /**
@@ -6839,9 +6838,8 @@ public class StringUtils {
         // distance
         if (p[n] <= threshold) {
             return p[n];
-        } else {
-            return -1;
         }
+        return -1;
     }
 
     // startsWith