Document PrettyTreeIndent.INDENT_STRINGS_SIZE 42/97442/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 11 Sep 2021 01:30:20 +0000 (03:30 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 11 Sep 2021 01:30:20 +0000 (03:30 +0200)
Explain what we are doing here, so that our future selves can properly
update the constant in the future.

Change-Id: I65d6187e8c56b30e5524a8e7c77c56b4b7d2c9ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/PrettyTreeIndent.java

index 2cfaa627fe11cc523c4d4757d8e7c6a97ffbdc72..9d07a12b2474d5bd37f6ac9332e1445cd4d8a77e 100644 (file)
@@ -22,6 +22,11 @@ import org.slf4j.LoggerFactory;
 final class PrettyTreeIndent {
     private static final Logger LOG = LoggerFactory.getLogger(PrettyTreeIndent.class);
     private static final int DEFAULT_INDENT = 4;
+    /**
+     * Size of indent table. The idea is to strike a balance between memory footprint and the number of operations we
+     * perform in {@link #indent(StringBuilder, int)}. Indentation up to {@value #INDENT_STRINGS_SIZE} result in a
+     * single operation.
+     */
     private static final int INDENT_STRINGS_SIZE = 16;
     private static final String[] INDENT_STRINGS;