[MNG-7899] Various memory usage improvements

Avoid creating a StringBuilder instance when not needed to reduce
temporary objects creation
This commit is contained in:
sebastien-doyon 2023-09-26 15:20:33 +02:00 committed by Slawomir Jaranowski
parent e4f68f037d
commit 0353476b1c
1 changed files with 1 additions and 1 deletions

View File

@ -400,10 +400,10 @@ public class MetadataGraph {
// ------------------------------------------------------------------------
@Override
public String toString() {
StringBuilder sb = new StringBuilder(512);
if (isEmpty()) {
return "empty";
}
StringBuilder sb = new StringBuilder(512);
for (MetadataGraphVertex v : vertices) {
sb.append("Vertex: ").append(v.getMd().toString()).append('\n');
List<MetadataGraphEdge> ins = getIncidentEdges(v);