speed up has_parens()

This commit is contained in:
alexlamsl 2018-03-21 18:59:29 +08:00
parent 73d77f4f64
commit d0ae61379f

View File

@ -576,7 +576,7 @@ function OutputStream(options) {
indentation : function() { return indentation }, indentation : function() { return indentation },
current_width : function() { return current_col - indentation }, current_width : function() { return current_col - indentation },
should_break : function() { return options.width && this.current_width() >= options.width }, 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, newline : newline,
print : print, print : print,
space : space, space : space,