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

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

[elpa] externals/capf-autosuggest 0ba985a 14/63: Minor simplification, u


From: ELPA Syncer
Subject: [elpa] externals/capf-autosuggest 0ba985a 14/63: Minor simplification, use pcase-let
Date: Wed, 27 Oct 2021 14:57:55 -0400 (EDT)

branch: externals/capf-autosuggest
commit 0ba985aa1ad236dfa954719dcc281b24402ad48c
Author: jakanakaevangeli <jakanakaevangeli@chiru.no>
Commit: jakanakaevangeli <jakanakaevangeli@chiru.no>

    Minor simplification, use pcase-let
---
 capf-autosuggest.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/capf-autosuggest.el b/capf-autosuggest.el
index 4b0e36e..00a7a44 100644
--- a/capf-autosuggest.el
+++ b/capf-autosuggest.el
@@ -99,9 +99,10 @@ point forward."
   (if completion-in-region-mode
       (capf-autosuggest-active-mode -1)
     (when capf-autosuggest-active-mode
-      (unless (< (car capf-autosuggest--region) (point)
-                 (cdr capf-autosuggest--region))
-        (capf-autosuggest-active-mode -1)))
+      ;; `identity' is used to generate slightly faster byte-code
+      (pcase-let ((`(,beg . ,end) (identity capf-autosuggest--region)))
+        (unless (< beg (point) end)
+          (capf-autosuggest-active-mode -1))))
 
     (unless capf-autosuggest-active-mode
       (pcase (run-hook-wrapped (if capf-autosuggest-capf



reply via email to

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