branch: elpa/anzu
commit 53db7f64b7924b9cfce9fecaed9b5a8e0c65143f
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>
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))