From d5d854c51a1e9daffecd1d374c3f346c529079d2 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 23 Nov 2018 22:32:41 -0500 Subject: [PATCH] remove double condition --- src/compile/render-dom/wrappers/EachBlock.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/compile/render-dom/wrappers/EachBlock.ts b/src/compile/render-dom/wrappers/EachBlock.ts index 19a824b0ed..910b83069c 100644 --- a/src/compile/render-dom/wrappers/EachBlock.ts +++ b/src/compile/render-dom/wrappers/EachBlock.ts @@ -479,17 +479,15 @@ export default class EachBlockWrapper extends Wrapper { } const update = deindent` - if (${condition}) { - ${this.vars.each_block_value} = ${snippet}; + ${this.vars.each_block_value} = ${snippet}; - for (var #i = ${start}; #i < ${this.vars.each_block_value}.${length}; #i += 1) { - const child_ctx = ${this.vars.get_each_context}(ctx, ${this.vars.each_block_value}, #i); + for (var #i = ${start}; #i < ${this.vars.each_block_value}.${length}; #i += 1) { + const child_ctx = ${this.vars.get_each_context}(ctx, ${this.vars.each_block_value}, #i); - ${forLoopBody} - } - - ${destroy} + ${forLoopBody} } + + ${destroy} `; if (bail) {