commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [1/2] [text] No need to nest statement in an else block.
Date Sun, 20 Nov 2016 15:55:29 GMT
Repository: commons-text
Updated Branches:
  refs/heads/master 7de03831b -> 10b97cb5f


No need to nest statement in an else block.

Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/fed66c0f
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/fed66c0f
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/fed66c0f

Branch: refs/heads/master
Commit: fed66c0f8976cd61e476bb7e633df659f74ea0e1
Parents: 7de0383
Author: Gary Gregory <ggregory@apache.org>
Authored: Sun Nov 20 07:54:19 2016 -0800
Committer: Gary Gregory <ggregory@apache.org>
Committed: Sun Nov 20 07:54:19 2016 -0800

----------------------------------------------------------------------
 src/main/java/org/apache/commons/text/WordUtils.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/fed66c0f/src/main/java/org/apache/commons/text/WordUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/WordUtils.java b/src/main/java/org/apache/commons/text/WordUtils.java
index 1d0085c..a2605ea 100644
--- a/src/main/java/org/apache/commons/text/WordUtils.java
+++ b/src/main/java/org/apache/commons/text/WordUtils.java
@@ -286,9 +286,8 @@ public class WordUtils {
                 if (matcher.start() == 0) {
                     offset += matcher.end();
                     continue;
-                }else {
-                    spaceToWrapAt = matcher.start();
                 }
+                spaceToWrapAt = matcher.start();
             }
 
             // only last line without leading spaces is left


Mime
View raw message