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 2020/06/28 16:13:57 UTC
[commons-text] 01/05: Reuse JRE.
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
commit 719a0efe03a332e834e2a2a2d7a7c2d80f607363
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jun 28 12:02:03 2020 -0400
Reuse JRE.
---
src/main/java/org/apache/commons/text/TextStringBuilder.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/text/TextStringBuilder.java b/src/main/java/org/apache/commons/text/TextStringBuilder.java
index 565cff8..db9110b 100644
--- a/src/main/java/org/apache/commons/text/TextStringBuilder.java
+++ b/src/main/java/org/apache/commons/text/TextStringBuilder.java
@@ -21,6 +21,7 @@ import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
import java.nio.CharBuffer;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
@@ -3010,9 +3011,7 @@ public class TextStringBuilder implements CharSequence, Appendable, Serializable
final int oldEnd = size;
final int newEnd = length;
size = length;
- for (int i = oldEnd; i < newEnd; i++) {
- buffer[i] = '\0';
- }
+ Arrays.fill(buffer, oldEnd, newEnd, '\0');
}
return this;
}