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 2021/08/26 19:59:30 UTC
[commons-lang] 01/02: Simplify.
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-lang.git
commit bfbf729ca79a43ef3abf09ac8ae7dfca70b3c74f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Aug 26 15:57:16 2021 -0400
Simplify.
---
src/main/java/org/apache/commons/lang3/StringUtils.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java
index 5f22048..8de2484 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -6865,10 +6865,7 @@ public class StringUtils {
* @since 2.4
*/
public static String replaceEachRepeatedly(final String text, final String[] searchList, final String[] replacementList) {
- // timeToLive should be 0 if not used or nothing to replace, else it's
- // the length of the replace array
- final int timeToLive = searchList == null ? 0 : searchList.length;
- return replaceEach(text, searchList, replacementList, true, timeToLive);
+ return replaceEach(text, searchList, replacementList, true, ArrayUtils.getLength(searchList));
}
/**