crossmintMapEquals<K, V> function
Structural equality for two nullable maps. Both null → equal. One null →
not equal. Otherwise length + key-wise == comparison.
Implementation
bool crossmintMapEquals<K, V>(Map<K, V>? a, Map<K, V>? b) {
if (identical(a, b)) {
return true;
}
if (a == null || b == null) {
return false;
}
if (a.length != b.length) {
return false;
}
for (final MapEntry<K, V> entry in a.entries) {
if (!b.containsKey(entry.key) || b[entry.key] != entry.value) {
return false;
}
}
return true;
}