diff --git a/lib/linq.ts b/lib/linq.ts index 22b2fab..1396bc1 100644 --- a/lib/linq.ts +++ b/lib/linq.ts @@ -397,13 +397,13 @@ class EnumerableImpl implements Enumerable, Iterable, IEnumerable { let res1: IteratorResult, res2: IteratorResult; let it1 = this[Symbol.iterator](); let it2 = other[Symbol.iterator](); - do { + while (true) { res1 = it1.next(); res2 = it2.next(); + if (res1.done && res2.done) return true; if ((res1.done != res2.done) || !equal(res1.value, res2.value)) { return false; } - } while (!(res1.done) && !(res2.done)); - return true; + }; }