From 41cf82870b73d3a8254c518b27dc02dcbb5032f5 Mon Sep 17 00:00:00 2001 From: thefliik Date: Wed, 23 Jan 2019 17:23:25 -0800 Subject: [PATCH] Minor optimization to repl.ts (#1561) --- js/repl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/repl.ts b/js/repl.ts index 806a3e1426eba3..4fae31eabc896e 100644 --- a/js/repl.ts +++ b/js/repl.ts @@ -124,7 +124,7 @@ function parenthesesAreOpen(code: string): boolean { if (bracePosition % 2 === 0) { stack.push(bracePosition + 1); // push next expected brace position } else { - if (stack.length === 0 || stack.pop() !== bracePosition) { + if (stack.pop() !== bracePosition) { return false; } }