speed up has_parens() (#3014)

This commit is contained in:
Alex Lam S.L 2018-03-24 04:05:28 +08:00 committed by GitHub
parent 12985d86c2
commit b1410be443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,