emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/js2-mode 3bbff3c 2/2: Use memq instead of member


From: ELPA Syncer
Subject: [elpa] externals/js2-mode 3bbff3c 2/2: Use memq instead of member
Date: Sat, 10 Jul 2021 18:57:15 -0400 (EDT)

branch: externals/js2-mode
commit 3bbff3c1064dfd43143c03b8e05bb9bcb387a842
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]