Refact iterator of Map with Java 8 forEach

See gh-1451
This commit is contained in:
diguage
2017-06-06 01:03:44 +08:00
committed by Stephane Nicoll
parent 5df053c44b
commit dab7a7f0ee
37 changed files with 117 additions and 184 deletions

View File

@@ -369,9 +369,7 @@ public class GenericConversionServiceTests {
watch.start("convert 4,000,000 manually");
for (int i = 0; i < 4000000; i++) {
Map<String, Integer> target = new HashMap<>(source.size());
for (Map.Entry<String, String> entry : source.entrySet()) {
target.put(entry.getKey(), Integer.valueOf(entry.getValue()));
}
source.forEach((k, v) -> target.put(k, Integer.valueOf(v)));
}
watch.stop();
// System.out.println(watch.prettyPrint());