This commit is contained in:
Simulant87 2024-03-18 23:07:22 +01:00 committed by GitHub
parent b75da07545
commit 6aed1cfeb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1694,7 +1694,7 @@ public class JSONArray implements Iterable<Object> {
*/ */
@SuppressWarnings("resource") @SuppressWarnings("resource")
public String toString(int indentFactor) throws JSONException { public String toString(int indentFactor) throws JSONException {
// each value requires a comma, so multiply the count my 2 // each value requires a comma, so multiply the count by 2
// We don't want to oversize the initial capacity // We don't want to oversize the initial capacity
int initialSize = myArrayList.size() * 2; int initialSize = myArrayList.size() * 2;
Writer sw = new StringBuilderWriter(Math.max(initialSize, 16)); Writer sw = new StringBuilderWriter(Math.max(initialSize, 16));