From 4890535b62aa5be6d75f57e5a2b4fbaf9eb3d34a Mon Sep 17 00:00:00 2001 From: Martin Ndegwa Date: Wed, 27 Sep 2023 20:28:23 +0300 Subject: [PATCH] Optimization PR Clean up --- .../smartregister/model/location/LocationHierarchyTree.java | 3 --- .../model/location/LocationHierarchyTreeTest.java | 3 +-- .../java/org/smartregister/model/location/utils/TestUtils.java | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/org/smartregister/model/location/LocationHierarchyTree.java b/src/main/java/org/smartregister/model/location/LocationHierarchyTree.java index 721b596..48b8d24 100755 --- a/src/main/java/org/smartregister/model/location/LocationHierarchyTree.java +++ b/src/main/java/org/smartregister/model/location/LocationHierarchyTree.java @@ -58,12 +58,9 @@ public void addLocation(Location location) { * @param locations */ public void buildTreeFromList(List locations) { - long start = System.currentTimeMillis(); for (Location location : locations) { addLocation(location); } - logger.info(String.format("LocationHierarchyTree.buildTreeFromList took : %d ms", System.currentTimeMillis() - start)); - } public Tree getLocationsHierarchy() { diff --git a/src/test/java/org/smartregister/model/location/LocationHierarchyTreeTest.java b/src/test/java/org/smartregister/model/location/LocationHierarchyTreeTest.java index 4c2e3ad..eb1b8c9 100644 --- a/src/test/java/org/smartregister/model/location/LocationHierarchyTreeTest.java +++ b/src/test/java/org/smartregister/model/location/LocationHierarchyTreeTest.java @@ -52,10 +52,9 @@ public void testAddLocationWithoutChildLocations() { @Test public void testBuildTreeFromList() { - List locationList = TestUtils.getTestLocations(); + List locationList = getLocationList(); LocationHierarchyTree locationHierarchyTree = new LocationHierarchyTree(); locationHierarchyTree.buildTreeFromList(locationList); - Tree tree = locationHierarchyTree.getLocationsHierarchy(); assertNotNull(tree); assertNotNull(tree.getTree()); diff --git a/src/test/java/org/smartregister/model/location/utils/TestUtils.java b/src/test/java/org/smartregister/model/location/utils/TestUtils.java index d5c03f0..b61f5a5 100644 --- a/src/test/java/org/smartregister/model/location/utils/TestUtils.java +++ b/src/test/java/org/smartregister/model/location/utils/TestUtils.java @@ -14,7 +14,6 @@ public static List getTestLocations() { List locationList = new ArrayList<>(); - int parentId = 1; for (Integer i = 1; i < TOTAL_LOCATIONS + 1; i++) {