[corelib] MapMixin improvements

Change-Id: I623b9ee1903db7942232af4b1953868efeac6f5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227460
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
diff --git a/sdk/lib/collection/maps.dart b/sdk/lib/collection/maps.dart
index b8673b1..e4a9357 100644
--- a/sdk/lib/collection/maps.dart
+++ b/sdk/lib/collection/maps.dart
@@ -125,9 +125,9 @@
   }
 
   void addAll(Map<K, V> other) {
-    for (K key in other.keys) {
-      this[key] = other[key] as V;
-    }
+    other.forEach((K key, V value) {
+      this[key] = value;
+    });
   }
 
   bool containsValue(Object? value) {