From 77d09dd7143799b205ee78d5704e4f165e560450 Mon Sep 17 00:00:00 2001 From: Benson Chu Date: Mon, 20 May 2024 16:47:27 -0500 Subject: [PATCH] Don't call match-string if no match was found --- lisp/llvm-lib/llvm-shared.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/llvm-lib/llvm-shared.el b/lisp/llvm-lib/llvm-shared.el index 06526ec..7101710 100644 --- a/lisp/llvm-lib/llvm-shared.el +++ b/lisp/llvm-lib/llvm-shared.el @@ -141,11 +141,10 @@ (defun projectile-dont-switch-when-conf-available (x) (if-let ((dir (lls/conf-get-safe 'root-dir)) (tools-dir - (progn - (string-match (rx line-start - "/scratch" - (group "/benson/tools" (+ (not "/")) "/")) - dir) + (when (string-match (rx line-start + "/scratch" + (group "/benson/tools" (* (not "/")) "/")) + dir) (match-string 1 dir)))) (remove-if #'(lambda (path) (and (string-match-p (rx "/benson/tools")