branch: externals/corfu
commit a5eae1b6a42db609b3286bdacdd7711ab784f47a
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Simplify conditional
---
corfu.el | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/corfu.el b/corfu.el
index 2456586..85677c8 100644
--- a/corfu.el
+++ b/corfu.el
@@ -717,11 +717,9 @@ completion began less than that number of seconds ago."
"Go forward N candidates."
(interactive "p")
(let ((index (+ corfu--index (or n 1))))
- (corfu--goto
- (cond
- ((not corfu-cycle) index)
- ((= corfu--total 0) -1)
- (t (1- (mod (1+ index) (1+ corfu--total))))))))
+ (corfu--goto (if corfu-cycle
+ (1- (mod (1+ index) (1+ corfu--total)))
+ index))))
(defun corfu-previous (&optional n)
"Go backward N candidates."