You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/07/12 07:18:27 UTC

[lucene-solr] 02/02: #85 Try to prevent so much resizing of this StringBuilder in Lucene.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 8086c4be5d92e04e617ebbcaf8111ac3ca44fe06
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sun Jul 12 02:18:04 2020 -0500

    #85 Try to prevent so much resizing of this StringBuilder in Lucene.
---
 lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java
index 26e7e3d..eaef6c6 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java
@@ -475,7 +475,9 @@ public final class IndexWriterConfig extends LiveIndexWriterConfig {
 
   @Override
   public String toString() {
-    StringBuilder sb = new StringBuilder(super.toString());
+    String superString = super.toString();
+    StringBuilder sb = new StringBuilder(superString.length() + 512);
+    sb.append(superString);
     sb.append("writer=").append(writer.get()).append("\n");
     return sb.toString();
   }