blob: 146ddd0c3f838d202593e21f37b8e666336e4c35 [file] [log] [blame]
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
bool equalLists<T>(List<T> a, List<T> b) {
if (identical(a, b)) return true;
if (a == null || b == null) return false;
if (a.length != b.length) return false;
for (int i = 0; i < a.length; ++i) {
if (a[i] != b[i]) return false;
}
return true;
}
bool equalMaps<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 (K key in a.keys) {
if (!b.containsKey(key) || a[key] != b[key]) return false;
}
return true;
}