From: Richard M. Stallman Date: Wed, 12 Jun 1996 21:47:59 +0000 (+0000) Subject: (Fset_keymap_parent): Return early if KEYMAP already has the proper parent. X-Git-Tag: emacs-19.34~440 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2a5af1cf4fe26c2f7518e2be34380c7439dc5ca3;p=emacs.git (Fset_keymap_parent): Return early if KEYMAP already has the proper parent. --- diff --git a/src/keymap.c b/src/keymap.c index a0c28bb0782..88f89cdf72b 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -307,6 +307,11 @@ PARENT should be nil or another keymap.") If we came to the end, add the parent in PREV. */ if (! CONSP (list) || EQ (Qkeymap, XCONS (list)->car)) { + /* If we already have the right parent, return now + so that we avoid the loops below. */ + if (EQ (XCONS (prev)->cdr, parent)) + return parent; + XCONS (prev)->cdr = parent; break; }