From cd1a4a4e9645e6cd65381c5d0acc2683584541ea Mon Sep 17 00:00:00 2001 From: David Braun Date: Mon, 27 Aug 2018 16:34:40 -0400 Subject: [PATCH] Simplify `slice`. --- lib/index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index 0125830..5a6bc21 100644 --- a/lib/index.js +++ b/lib/index.js @@ -252,11 +252,7 @@ const Channel = function(length = 0) { (async () => { // Consume values before the starting point. for (let index = 0; index < start; index++) { - const value = await readOnly.shift(); - - if (value === undefined) { - break; - } + await readOnly.shift(); } for (let index = start; index < end; index++) {