Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.7.0
-
None
Description
I think that iterating by key/value pairs in Map should be done in more appropriate way than it is done currently: it takes set of keys, iterates by it and on each iteration cycle searchches for the value via Map.get(<key>) API. Consequently it does the search by key in map on every step and it should make the processign slower.
An alternative to such approach is to use Map.entrySet() API which returns the Set of key/value pairs (as instances of Map.Entry class). Using it eliminates the need to do a search by key (Map.get(...) API) in the map on each step of iteration and should work faster.