Subject: bug#43056: [PATCH] eshell/em-hist.el: Remove unnecessary check

From: Brian Leung <[email-masked]>
Date: Wed, 26 Aug 2020 07:29:03 +0200 (CEST)

There's no need to check n here since we're always taking the mod.

-- 
Sent with https://mailfence.com
Secure and private email

>From 7d4843ecc817036158e77a3819f1545604602543 Mon Sep 17 00:00:00 2001
From: Brian Leung <[email-masked]>
Date: Tue, 25 Aug 2020 22:06:51 -0700
Subject: [PATCH] eshell: Remove unnecessary check in em-hist

Both before and within the while loop, n is always between [0, len] inclusive.

Copyright-paperwork-exempt: yes
---
 lisp/eshell/em-hist.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index 267936583e..5cee1bad36 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -862,7 +862,7 @@ eshell-previous-matching-input-string-position
       (setq prev n
 	    n (mod (+ n motion) len))
       ;; If we haven't reached a match, step some more.
-      (while (and (< n len) (not tried-each-ring-item)
+      (while (and (not tried-each-ring-item)
 		  (not (string-match regexp (eshell-get-history n))))
 	(setq n (mod (+ n motion) len)
 	      ;; If we have gone all the way around in this search.
-- 
2.28.0