commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r643952 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java
Date Wed, 02 Apr 2008 16:08:00 GMT
Author: ggregory
Date: Wed Apr  2 09:07:54 2008
New Revision: 643952

URL: http://svn.apache.org/viewvc?rev=643952&view=rev
Log:
Simplify branching.

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java?rev=643952&r1=643951&r2=643952&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java Wed Apr  2 09:07:54
2008
@@ -167,16 +167,13 @@
         if (negated) {
             if (range.negated) {
                 return start >= range.start && end <= range.end;
-            } else {
-                return range.end < start || range.start > end;
-            }
-        } else {
-            if (range.negated) {
-                return start == 0 && end == Character.MAX_VALUE;
-            } else {
-                return start <= range.start && end >= range.end;
             }
+            return range.end < start || range.start > end;
+        }
+        if (range.negated) {
+            return start == 0 && end == Character.MAX_VALUE;
         }
+        return start <= range.start && end >= range.end;
     }
 
     // Basics



Mime
View raw message