From 8086c4be5d92e04e617ebbcaf8111ac3ca44fe06 Mon Sep 17 00:00:00 2001 From: "markrmiller@gmail.com" Date: Sun, 12 Jul 2020 02:18:04 -0500 Subject: [PATCH] #85 Try to prevent so much resizing of this StringBuilder in Lucene. --- .../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 26e7e3dbb6af..eaef6c68fd0c 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 IndexWriterConfig setIndexSort(Sort sort) { @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(); }