branch: elpa/buttercup commit 8d918933e7997e779a967820f5b158c27b376fc7 Author: Ola Nilsson <ola.nils...@gmail.com> Commit: Ola Nilsson <ola.nils...@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."