branch: externals/company commit eae259bbcb2aa59859cd0b7ad44cb619e77c0691 Author: Konstantin Kharlamov <hi-an...@yandex.ru> Commit: Konstantin Kharlamov <hi-an...@yandex.ru>
treewide: replace (string= … "") comparisons with (string-empty-p …) --- company-ispell.el | 2 +- company.el | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/company-ispell.el b/company-ispell.el index d40d8c6eb4..2699d30bed 100644 --- a/company-ispell.el +++ b/company-ispell.el @@ -81,7 +81,7 @@ If nil, use `ispell-complete-word-dict' or `ispell-alternate-dictionary'." (lambda () (ispell-lookup-words "" dict)) :check-tag dict)) (completion-ignore-case t)) - (if (string= arg "") + (if (string-empty-p arg) ;; Small optimization. all-words (company-substitute-prefix diff --git a/company.el b/company.el index 638bba88df..3c5bcea94e 100644 --- a/company.el +++ b/company.el @@ -2506,7 +2506,7 @@ each one wraps a part of the input string." (defun company--search-update-predicate (ss) (let* ((re (funcall company-search-regexp-function ss)) (company-candidates-predicate - (and (not (string= re "")) + (and (not (string-empty-p re)) company-search-filtering (lambda (candidate) (string-match-p re candidate)))) (cc (company-calculate-candidates company-prefix @@ -2524,7 +2524,7 @@ each one wraps a part of the input string." (defun company--search-assert-input () (company--search-assert-enabled) - (when (string= company-search-string "") + (when (string-empty-p company-search-string) (user-error "Empty search string"))) (defun company-search-repeat-forward () @@ -2577,7 +2577,7 @@ each one wraps a part of the input string." (defun company-search-delete-char () (interactive) (company--search-assert-enabled) - (if (string= company-search-string "") + (if (string-empty-p company-search-string) (ding) (let ((ss (substring company-search-string 0 -1))) (when company-search-filtering @@ -3427,7 +3427,7 @@ If SHOW-VERSION is non-nil, show the version in the echo area." nil line)) (when (let ((re (funcall company-search-regexp-function company-search-string))) - (and (not (string= re "")) + (and (not (string-empty-p re)) (string-match re value))) (pcase-dolist (`(,mbeg . ,mend) (company--search-chunks)) (let ((beg (+ margin mbeg))