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

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

[nongnu] elpa/buttercup 8d91893 232/340: Optimize spy-calls-count-errors


From: ELPA Syncer
Subject: [nongnu] elpa/buttercup 8d91893 232/340: Optimize spy-calls-count-errors and spy-calls-count-returned
Date: Thu, 16 Dec 2021 14:59:40 -0500 (EST)

branch: elpa/buttercup
commit 8d918933e7997e779a967820f5b158c27b376fc7
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>

    Optimize spy-calls-count-errors and spy-calls-count-returned
    
    Use cl-count-if instead.
---
 buttercup.el | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index c3465ab..5fc7523 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1231,13 +1231,11 @@ responsibility to ensure ARG is a command."
 
 (defun spy-calls-count-returned (spy)
   "Return the number of times SPY has been called successfully so far."
-  (length (cl-remove-if-not 'spy-context-return-p
-                            (spy-calls-all spy))))
+  (cl-count-if 'spy-context-return-p (spy-calls-all spy)))
 
 (defun spy-calls-count-errors (spy)
   "Return the number of times SPY has been called and thrown errors so far."
-  (length (cl-remove-if-not 'spy-context-thrown-p
-                            (spy-calls-all spy))))
+  (cl-count-if 'spy-context-thrown-p (spy-calls-all spy)))
 
 (defun spy-calls-args-for (spy index)
   "Return the context of the INDEXth call to SPY."



reply via email to

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