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

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

[nongnu] elpa/anzu 53db7f64b7 177/288: Reduce condition check


From: ELPA Syncer
Subject: [nongnu] elpa/anzu 53db7f64b7 177/288: Reduce condition check
Date: Thu, 6 Jan 2022 03:58:50 -0500 (EST)

branch: elpa/anzu
commit 53db7f64b7924b9cfce9fecaed9b5a8e0c65143f
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>

    Reduce condition check
---
 anzu.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/anzu.el b/anzu.el
index ef061a71bb..a552421625 100644
--- a/anzu.el
+++ b/anzu.el
@@ -440,11 +440,12 @@
 (defun anzu--compile-replace-text (str)
   (let ((compiled (ignore-errors
                     (query-replace-compile-replacement str t))))
-    (cond ((stringp compiled) compiled)
-          ((and (consp compiled) (functionp (car compiled)))
-           compiled)
-          ((and (consp compiled) (stringp (car compiled)))
-           (car compiled)))))
+    (when compiled
+      (cond  ((stringp compiled) compiled)
+             ((and (consp compiled) (functionp (car compiled)))
+              compiled)
+             ((and (consp compiled) (stringp (car compiled)))
+              (car compiled))))))
 
 (defun anzu--evaluate-occurrence (ov to-regexp replacements fixed-case 
from-regexp)
   (let ((from-string (overlay-get ov 'from-string))



reply via email to

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