From d0ae61379f147f75057c60670a25bf3b5389c6d4 Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Wed, 21 Mar 2018 18:59:29 +0800 Subject: [PATCH] speed up `has_parens()` --- lib/output.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/output.js b/lib/output.js index 6c1d61a3..f60b474c 100644 --- a/lib/output.js +++ b/lib/output.js @@ -576,7 +576,7 @@ function OutputStream(options) { indentation : function() { return indentation }, current_width : function() { return current_col - indentation }, should_break : function() { return options.width && this.current_width() >= options.width }, - has_parens : function() { return OUTPUT.slice(-1) == "(" }, + has_parens : function() { return OUTPUT[OUTPUT.length - 1] == "(" }, newline : newline, print : print, space : space,