branch: master commit 4e0d403c724703ad12e1ffbbbfaa1be9c1ea1257 Author: Basil L. Contovounesios <conto...@tcd.ie> Commit: Basil L. Contovounesios <conto...@tcd.ie>
counsel.el (counsel--find-build-subdir): Simplify --- counsel.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/counsel.el b/counsel.el index fb07afc..98ced9a 100644 --- a/counsel.el +++ b/counsel.el @@ -5198,13 +5198,11 @@ The optional BLDDIR is useful for other helpers that have found (counsel--get-make-targets srcdir blddir)))) (defun counsel--find-build-subdir (srcdir) - "Return builds sub-directory of SRCDIR, if one exists." - (cl-some - (lambda (x) - (let ((check (expand-file-name x srcdir))) - (when (file-directory-p check) - check))) - counsel-compile-build-directories)) + "Return builds subdirectory of SRCDIR, if one exists." + (cl-some (lambda (dir) + (setq dir (expand-file-name dir srcdir)) + (and (file-directory-p dir) dir)) + counsel-compile-build-directories)) (defun counsel--get-build-subdirs (blddir) "Return all subdirs of BLDDIR sorted by access time."