Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function iterate (map: SortedMapStructure): IterableIterator, V>> {
return iterateFromFirst(map._sorted);
}
export function iteratePairs (map: SortedMapStructure): IterableIterator<[K, V]> {
return new MappableIterator, V>, [K, V]>(iterateFromFirst(map._sorted), toPair);
}
export function isEqual (set: SortedSetStructure, other: SortedSetStructure): boolean {
if(set === other) return true;
if(size(set) !== size(other) ||
set._select !== other._select ||
set._compare !== other._compare) return false;
var a = set._tree, b = other._tree;
var ita = iterateFromFirst(a), itb = iterateFromFirst(b);
do {
var ca = ita.next();
var cb = itb.next();
if(!equals(ca.value.value, cb.value.value)) return false;
} while(!ca.done);
return true;
}
export function isEqual (set: SortedMapStructure, other: SortedMapStructure): boolean {
if(set === other) return true;
if(size(set) !== size(other) ||
set._select !== other._select ||
set._compare !== other._compare) return false;
var a = set._sorted, b = other._sorted;
var ita = iterateFromFirst(a), itb = iterateFromFirst(b);
do {
var ca = ita.next();
var cb = itb.next();
if(!equals(ca.value.value, cb.value.value)) return false;
} while(!ca.done);
return true;
}