changeset 15422:dd639432a55a

(Fset_keymap_parent): Return early if KEYMAP already has the proper parent.
author Richard M. Stallman <rms@gnu.org>
date Wed, 12 Jun 1996 21:47:59 +0000
parents 2dc1a3e42a20
children 5b9fe08fa6eb
files src/keymap.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
 	}