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

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

[nongnu] elpa/buttercup bcaa7f0 163/340: Use buttercup--specs where poss


From: ELPA Syncer
Subject: [nongnu] elpa/buttercup bcaa7f0 163/340: Use buttercup--specs where possible
Date: Thu, 16 Dec 2021 14:59:26 -0500 (EST)

branch: elpa/buttercup
commit bcaa7f0cd580e0d64462e95f429a08002044f991
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Jorgen Schäfer <Jorgen.Schaefer@gmail.com>

    Use buttercup--specs where possible
    
    Replace buttercup--specs-and-suites with buttercup--specs where
    possible.
---
 buttercup.el | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 54d54ba..d72b245 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -705,19 +705,11 @@ See also `buttercup-define-matcher'."
 
 (defun buttercup-suites-total-specs-defined (suite-list)
   "Return the number of specs defined in all suites in SUITE-LIST."
-  (let ((nspecs 0))
-    (dolist (spec-or-suite (buttercup--specs-and-suites suite-list))
-      (when (buttercup-spec-p spec-or-suite)
-        (setq nspecs (1+ nspecs))))
-    nspecs))
+  (length (buttercup--specs suite-list)))
 
 (defun buttercup-suites-total-specs-status (suite-list status)
   "Return the number of specs in SUITE-LIST marked with STATUS."
-  (let ((nspecs 0))
-    (dolist (spec-or-suite (buttercup--specs-and-suites suite-list) nspecs)
-      (when (and (buttercup-spec-p spec-or-suite)
-                 (eq (buttercup-spec-status spec-or-suite) status))
-        (setq nspecs (1+ nspecs))))))
+  (cl-count status (buttercup--specs suite-list) :key #'buttercup-spec-status))
 
 (defun buttercup-suites-total-specs-pending (suite-list)
   "Return the number of specs marked as pending in all suites in SUITE-LIST."
@@ -766,8 +758,7 @@ See also `buttercup-define-matcher'."
 (defun buttercup--full-spec-names (spec-or-suite-list)
   "Return full names of all specs in SPEC-OR-SUITE-LIST."
   (cl-loop
-   for x in (buttercup--specs-and-suites spec-or-suite-list)
-   if (buttercup-spec-p x)
+   for x in (buttercup--specs spec-or-suite-list)
    collect (buttercup-spec-full-name x)))
 
 (defun buttercup--find-duplicate-spec-names (spec-or-suite-list)



reply via email to

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