From: Jérôme Benoit Date: Fri, 18 Jan 2019 10:29:40 +0000 (+0100) Subject: Code cleanup. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=40a334105841fc2f6e175291e9e7bcfe56f3437c;p=Persons_Comparator.git Code cleanup. Signed-off-by: Jérôme Benoit --- diff --git a/src/RegionView.java b/src/RegionView.java index 3c79ea6..d44cd04 100644 --- a/src/RegionView.java +++ b/src/RegionView.java @@ -57,18 +57,14 @@ public class RegionView extends JPanel { public static DefaultMutableTreeNode sortTree(DefaultMutableTreeNode root) { { for (int i = 0; i < root.getChildCount() - 1; i++) { - DefaultMutableTreeNode node = (DefaultMutableTreeNode) root - .getChildAt(i); + DefaultMutableTreeNode node = (DefaultMutableTreeNode) root.getChildAt(i); String nt = node.getUserObject().toString(); for (int j = i + 1; j <= root.getChildCount() - 1; j++) { DefaultMutableTreeNode prevNode = (DefaultMutableTreeNode) root .getChildAt(j); String np = prevNode.getUserObject().toString(); - - System.out.println(nt + " " + np); if (nt.compareToIgnoreCase(np) > 0) { - root.insert(node, j); break; } @@ -77,7 +73,6 @@ public class RegionView extends JPanel { node = sortTree(node); } } - return root; } }