[vm] Fix comment compact hash implementation

The `_CompactIterableImmutable` does not check for concurrent
modifications, because the underlying map is immutable.

The comment was wrong.

Change-Id: I992d841cb6b42d027e8ae5bb853c8345a0f7a69d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245160
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
diff --git a/sdk/lib/_internal/vm/lib/compact_hash.dart b/sdk/lib/_internal/vm/lib/compact_hash.dart
index 003be2c..8a179fb6 100644
--- a/sdk/lib/_internal/vm/lib/compact_hash.dart
+++ b/sdk/lib/_internal/vm/lib/compact_hash.dart
@@ -695,10 +695,8 @@
   final int _checkSum;
   E? _current;
 
-  _CompactIterator(
-      _HashBase table, this._data, this._len, this._offset, this._step)
-      : _table = table,
-        _checkSum = table._checkSum;
+  _CompactIterator(this._table, this._data, this._len, this._offset, this._step)
+      : _checkSum = _table._checkSum;
 
   bool moveNext() {
     if (_table._isModifiedSince(_data, _checkSum)) {
@@ -720,7 +718,9 @@
 }
 
 // Iterates through _data[_offset + _step], _data[_offset + 2*_step], ...
-// and checks for concurrent modification.
+//
+// Does not check for concurrent modification since the table
+// is known to be immutable.
 class _CompactIterableImmutable<E> extends Iterable<E> {
   // _HashBase with _HashVMImmutableBase.
   final _HashBase _table;
@@ -749,13 +749,10 @@
   final int _len;
   int _offset;
   final int _step;
-  final int _checkSum;
   E? _current;
 
   _CompactIteratorImmutable(
-      _HashBase table, this._data, this._len, this._offset, this._step)
-      : _table = table,
-        _checkSum = table._checkSum;
+      this._table, this._data, this._len, this._offset, this._step);
 
   bool moveNext() {
     _offset += _step;