Skip to content

Commit

Permalink
Optimization PR Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegwamartin committed Sep 27, 2023
1 parent 402512d commit 4890535
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,9 @@ public void addLocation(Location location) {
* @param locations
*/
public void buildTreeFromList(List<Location> 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ public void testAddLocationWithoutChildLocations() {

@Test
public void testBuildTreeFromList() {
List<Location> locationList = TestUtils.getTestLocations();
List<Location> locationList = getLocationList();
LocationHierarchyTree locationHierarchyTree = new LocationHierarchyTree();
locationHierarchyTree.buildTreeFromList(locationList);

Tree tree = locationHierarchyTree.getLocationsHierarchy();
assertNotNull(tree);
assertNotNull(tree.getTree());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public static List<Location> getTestLocations() {

List<Location> locationList = new ArrayList<>();


int parentId = 1;

for (Integer i = 1; i < TOTAL_LOCATIONS + 1; i++) {
Expand Down

0 comments on commit 4890535

Please sign in to comment.