This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-text.git
The following commit(s) were added to refs/heads/master by this push: new e104458 simplify if in CaseUtils (#134) e104458 is described below commit e1044588c0f3c8abb4d78eb740e1385b2cb7d862 Author: XenoAmess <xenoam...@gmail.com> AuthorDate: Tue Jul 21 21:57:11 2020 +0800 simplify if in CaseUtils (#134) --- src/main/java/org/apache/commons/text/CaseUtils.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/text/CaseUtils.java b/src/main/java/org/apache/commons/text/CaseUtils.java index cbdae7e..5a6dfa3 100644 --- a/src/main/java/org/apache/commons/text/CaseUtils.java +++ b/src/main/java/org/apache/commons/text/CaseUtils.java @@ -91,10 +91,7 @@ public class CaseUtils { final int codePoint = str.codePointAt(index); if (delimiterSet.contains(codePoint)) { - capitalizeNext = true; - if (outOffset == 0) { - capitalizeNext = false; - } + capitalizeNext = outOffset != 0; index += Character.charCount(codePoint); } else if (capitalizeNext || outOffset == 0 && capitalizeFirstLetter) { final int titleCaseCodePoint = Character.toTitleCase(codePoint);