From 0b3f0238dca91ea60d3ec8b2f55e60098117ccda Mon Sep 17 00:00:00 2001 From: "Afshin T. Darian" Date: Sat, 13 Aug 2022 23:18:16 +0100 Subject: [PATCH] Tweak retro() for readability --- packages/algorithm/src/retro.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/algorithm/src/retro.ts b/packages/algorithm/src/retro.ts index 86f9b580d..34163d378 100644 --- a/packages/algorithm/src/retro.ts +++ b/packages/algorithm/src/retro.ts @@ -44,9 +44,9 @@ export function retro( if (typeof (object as any).retro === 'function') { return (object as IRetroable).retro(); } - return (function* () { - for (let index = (object as ArrayLike).length - 1; ~index; index--) { - yield (object as ArrayLike)[index]; + return (function* (object) { + for (let index = object.length - 1; ~index; index--) { + yield object[index]; } - })(); + })(object as ArrayLike); }