commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1586289 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
Date Thu, 10 Apr 2014 13:10:59 GMT
Author: ggregory
Date: Thu Apr 10 13:10:59 2014
New Revision: 1586289

URL: http://svn.apache.org/r1586289
Log:
Statement unnecessarily nested within else clause.

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

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java?rev=1586289&r1=1586288&r2=1586289&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
Thu Apr 10 13:10:59 2014
@@ -69,18 +69,17 @@ public class CharSequenceUtils {
     static int indexOf(final CharSequence cs, final int searchChar, int start) {
         if (cs instanceof String) {
             return ((String) cs).indexOf(searchChar, start);
-        } else {
-            final int sz = cs.length();
-            if (start < 0) {
-                start = 0;
-            }
-            for (int i = start; i < sz; i++) {
-                if (cs.charAt(i) == searchChar) {
-                    return i;
-                }
+        }
+        final int sz = cs.length();
+        if (start < 0) {
+            start = 0;
+        }
+        for (int i = start; i < sz; i++) {
+            if (cs.charAt(i) == searchChar) {
+                return i;
             }
-            return -1;
         }
+        return -1;
     }
 
     /**



Mime
View raw message