Hi,
We find that there are several inefficient usages of Java Collections:
The contains method is invoked upon a list object in a loop. We recommend replacing it with a HashSet.
Random access can occur at several linkedlist objects, which run in linear time complexity. We recommend replacing them with Arraylist objects.
There is no iteration occurring upon a LinkedHashMap, thus the insertion order does not matter. We recommend replacing it with a HashMap.
ArrayList is inserted before an iteration, while multiple memory reallocation might occur when the size of the list exceeds its capacity. We recommend replacing it with a LinkedList.
We discovered the above inefficient usage of containers by our tool Ditto. The patch is submitted in #3926. Could you please check and accept it? We have tested the patch on our PC. The patched program works well.
Bests
Ditto
Hi,
We find that there are several inefficient usages of Java Collections:
The contains method is invoked upon a list object in a loop. We recommend replacing it with a HashSet.
Random access can occur at several linkedlist objects, which run in linear time complexity. We recommend replacing them with Arraylist objects.
There is no iteration occurring upon a LinkedHashMap, thus the insertion order does not matter. We recommend replacing it with a HashMap.
ArrayList is inserted before an iteration, while multiple memory reallocation might occur when the size of the list exceeds its capacity. We recommend replacing it with a LinkedList.
We discovered the above inefficient usage of containers by our tool Ditto. The patch is submitted in #3926. Could you please check and accept it? We have tested the patch on our PC. The patched program works well.
Bests
Ditto