branch: externals/js2-mode commit 3bbff3c1064dfd43143c03b8e05bb9bcb387a842 Author: Dmitry Gutov <dgu...@yandex.ru> Commit: Dmitry Gutov <dgu...@yandex.ru>
Use memq instead of member TBH, perf improvement is within the margin of error. --- js2-mode.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js2-mode.el b/js2-mode.el index 35b741c..d72f4ec 100644 --- a/js2-mode.el +++ b/js2-mode.el @@ -11071,8 +11071,8 @@ expression)." (when (and (>= js2-language-version 200) (= js2-NAME tt) (member prop '("get" "set" "async")) - (member (js2-peek-token 'KEYWORD_IS_NAME) - (list js2-NAME js2-PRIVATE_NAME js2-STRING js2-NUMBER js2-LB))) + (memq (js2-peek-token 'KEYWORD_IS_NAME) + `(,js2-NAME ,js2-PRIVATE_NAME ,js2-STRING ,js2-NUMBER ,js2-LB))) (setq previous-token (js2-current-token) tt (js2-get-prop-name-token)))) (cond @@ -11083,7 +11083,7 @@ expression)." (setq after-comma nil elem (js2-make-unary nil js2-TRIPLEDOT 'js2-parse-assign-expr))) ;; Found a key/value property (of any sort) - ((member tt (list js2-NAME js2-PRIVATE_NAME js2-STRING js2-NUMBER js2-LB)) + ((memq tt `(,js2-NAME ,js2-PRIVATE_NAME ,js2-STRING ,js2-NUMBER ,js2-LB)) (setq after-comma nil elem (js2-parse-named-prop tt previous-token class-p)) (if (and (null elem) @@ -11235,9 +11235,9 @@ string or expression." ((and (>= js2-language-version 200) (if class-p (and (setq tt (js2-peek-token-or-eol)) - (member tt (list js2-EOL js2-RC js2-SEMI))) + (memq tt `(,js2-EOL ,js2-RC ,js2-SEMI))) (and (setq tt (js2-peek-token)) - (member tt (list js2-COMMA js2-RC)) + (memq tt `(,js2-COMMA ,js2-RC)) (js2-name-node-p prop)))) (setq result (make-js2-object-prop-node :pos pos