emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp 9809f7e: Use `length=' and family where possible in


From: Andrea Corallo
Subject: feature/native-comp 9809f7e: Use `length=' and family where possible in native comp code
Date: Sun, 7 Mar 2021 15:47:07 -0500 (EST)

branch: feature/native-comp
commit 9809f7ed2c639bd51abd4a28bd5d1a37f0d46a3d
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    Use `length=' and family where possible in native comp code
    
        * lisp/emacs-lisp/comp-cstr.el (comp-intersect-typesets)
        (comp-cstr-imm): Use Use `length=' and family where possible.
        * lisp/emacs-lisp/comp.el (comp-add-cond-cstrs-target-block)
        (comp-compute-dominator-frontiers)
        (batch-byte-native-compile-for-bootstrap): Likewise.
---
 lisp/emacs-lisp/comp-cstr.el | 4 ++--
 lisp/emacs-lisp/comp.el      | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
index 4397a91..d0b842e 100644
--- a/lisp/emacs-lisp/comp-cstr.el
+++ b/lisp/emacs-lisp/comp-cstr.el
@@ -287,7 +287,7 @@ Return them as multiple value."
 (defun comp-intersect-typesets (&rest typesets)
   "Intersect types present into TYPESETS."
   (unless (cl-some #'null typesets)
-    (if (= (length typesets) 1)
+    (if (length= typesets 1)
         (car typesets)
       (comp-normalize-typeset
        (cl-reduce #'comp-intersect-two-typesets typesets)))))
@@ -823,7 +823,7 @@ Non memoized version of `comp-cstr-intersection-no-mem'."
                          (valset ,cstr) (list ,val)))))))
   (with-comp-cstr-accessors
     (let ((v (valset cstr)))
-      (if (= (length v) 1)
+      (if (length= v 1)
           (car v)
         (caar (range cstr))))))
 
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 7b2883b..81ab361 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2364,7 +2364,7 @@ TARGET-BB-SYM is the symbol name of the target block."
                              (comp-func-blocks comp-func)))
          (target-bb-in-edges (comp-block-in-edges target-bb)))
     (cl-assert target-bb-in-edges)
-    (if (= (length target-bb-in-edges) 1)
+    (if (length= target-bb-in-edges 1)
         ;; If block has only one predecessor is already suitable for
         ;; adding constraint assumptions.
         target-bb
@@ -2780,7 +2780,7 @@ blocks."
            for b-name being each hash-keys of blocks
            using (hash-value b)
            for preds = (comp-block-preds b)
-           when (>= (length preds) 2) ; All joins
+           when (length> preds 1) ; All joins
            do (cl-loop for p in preds
                        for runner = p
                        do (while (not (eq runner (comp-block-idom b)))
@@ -4104,7 +4104,7 @@ environment variable 'NATIVE_DISABLED' is set, only byte 
compile."
   (comp-ensure-native-compiler)
   (if (equal (getenv "NATIVE_DISABLED") "1")
       (batch-byte-compile)
-    (cl-assert (= 1 (length command-line-args-left)))
+    (cl-assert (length= command-line-args-left 1))
     (let ((byte-native-for-bootstrap t)
           (byte-to-native-output-file nil))
       (batch-native-compile)



reply via email to

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