Skip to content

Commit

Permalink
chore: removed useless commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MrIkso committed Nov 17, 2024
1 parent d05375a commit 6305d3a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions treeview/src/main/java/com/mrikso/treeview/TreeItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,19 @@ public String toString() {
return printTree(0);
}

private static final int indent = 4; // Увеличим отступ для читабельности
private static final int indent = 4;

private String printTree(int increment) {
StringBuilder s;
StringBuilder inc = new StringBuilder();

// Генерируем отступ для текущего уровня

for (int i = 0; i < increment; ++i) {
inc.append(" ");
}

// Выводим текущее значение узла
s = new StringBuilder(inc + "|-- " + value);

// Выводим все дочерние элементы
for (TreeItem<T> child : children) {
s.append("\n").append(child.printTree(increment + indent));
}
Expand Down

0 comments on commit 6305d3a

Please sign in to comment.