diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2015-10-10 00:17:11 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-10-10 00:18:39 -0700 |
| commit | bb7c182fdaf8553ffdc9162f322177ae2f7fa0c2 (patch) | |
| tree | 444b1eef3d424cb5b07396a11bc66fe401d0a1dd /src/keymap.c | |
| parent | 1196e3fca6f9df107c76438b7d00090d19b13570 (diff) | |
CHECK_IMPURE and PURE_P speedup
* src/intervals.c (create_root_interval):
Do CHECK_IMPURE only for strings; not needed for buffers.
Prefer ! STRINGP to BUFFERP, for a tad more speed.
* src/puresize.h (CHECK_IMPURE, PURE_P):
Now inline functions instead of macros.
(PURE_P): Don’t use XPNTR; that is now the caller’s responsibility.
All callers changed.
(CHECK_IMPURE): New argument PTR, to save us the work of running XPNTR.
All callers changed.
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/keymap.c b/src/keymap.c index 6a8d129ce2b..81091f03d70 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -341,7 +341,7 @@ Return PARENT. PARENT should be nil or another keymap. */) If we came to the end, add the parent in PREV. */ if (!CONSP (list) || KEYMAPP (list)) { - CHECK_IMPURE (prev); + CHECK_IMPURE (prev, XCONS (prev)); XSETCDR (prev, parent); return parent; } @@ -750,7 +750,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def) /* If we are preparing to dump, and DEF is a menu element with a menu item indicator, copy it to ensure it is not pure. */ - if (CONSP (def) && PURE_P (def) + if (CONSP (def) && PURE_P (XCONS (def)) && (EQ (XCAR (def), Qmenu_item) || STRINGP (XCAR (def)))) def = Fcons (XCAR (def), XCDR (def)); @@ -798,7 +798,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def) { if (NATNUMP (idx) && XFASTINT (idx) < ASIZE (elt)) { - CHECK_IMPURE (elt); + CHECK_IMPURE (elt, XVECTOR (elt)); ASET (elt, XFASTINT (idx), def); return def; } @@ -851,7 +851,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def) } else if (EQ (idx, XCAR (elt))) { - CHECK_IMPURE (elt); + CHECK_IMPURE (elt, XCONS (elt)); XSETCDR (elt, def); return def; } @@ -895,7 +895,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def) } else elt = Fcons (idx, def); - CHECK_IMPURE (insertion_point); + CHECK_IMPURE (insertion_point, XCONS (insertion_point)); XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point))); } } |
