From 8eb433b5d36ba65cfe5c4ecd6ac3a810254ddacd Mon Sep 17 00:00:00 2001 From: Simon Holloway Date: Fri, 5 Jan 2024 21:36:10 +0000 Subject: [PATCH 1/2] refactor(async): prepare for `noUncheckedIndexedAccess` (#4118) * refactor(async): prepare for noUncheckedIndexedAccess * revert(data_structures): the data_structures refactor since its not in scope for this PR --- async/mux_async_iterator.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/async/mux_async_iterator.ts b/async/mux_async_iterator.ts index 2bfd96b0e8f53..1bb4802881afc 100644 --- a/async/mux_async_iterator.ts +++ b/async/mux_async_iterator.ts @@ -73,8 +73,7 @@ export class MuxAsyncIterator implements AsyncIterable { await this.#signal.promise; // Note that while we're looping over `yields`, new items may be added. - for (let i = 0; i < this.#yields.length; i++) { - const { iterator, value } = this.#yields[i]; + for (const { iterator, value } of this.#yields) { yield value; this.#callIteratorNext(iterator); } From bd08c2b57d37f6443aa5f6a58dc5b3f5e981effc Mon Sep 17 00:00:00 2001 From: Simon Holloway Date: Fri, 5 Jan 2024 21:37:29 +0000 Subject: [PATCH 2/2] refactor(bytes): prepare for `noUncheckedIndexedAccess` (#4119) refactor(bytes): prepare for noUncheckedIndexedAccess --- bytes/equals_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bytes/equals_test.ts b/bytes/equals_test.ts index a31cc5a360e19..84e26fae93a75 100644 --- a/bytes/equals_test.ts +++ b/bytes/equals_test.ts @@ -19,7 +19,7 @@ Deno.test("equals() handles randomized testing", () => { const arr3 = arr1.slice(0); // the chance of arr1 equaling arr2 is basically 0 // but introduce an inequality at the end just in case - arr2[arr2.length - 1] = arr1[arr1.length - 1] ^ 1; + arr2[arr2.length - 1] = arr1.at(-1)! ^ 1; // arr3 is arr1 but with an inequality in the very last element // this is to test the equality check when length isn't a multiple of 4 arr3[arr3.length - 1] ^= 1;