# HG changeset patch # User Richard M. Stallman # Date 834616079 0 # Node ID dd639432a55a7c902632732bf38a94240c48bcf1 # Parent 2dc1a3e42a20b8ebdea0f963a2084616407c37b3 (Fset_keymap_parent): Return early if KEYMAP already has the proper parent. diff -r 2dc1a3e42a20 -r dd639432a55a src/keymap.c --- a/src/keymap.c Wed Jun 12 21:47:03 1996 +0000 +++ b/src/keymap.c Wed Jun 12 21:47:59 1996 +0000 @@ -307,6 +307,11 @@ 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; }