aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-07-10 12:43:46 +0400
committerDmitry Antipov2012-07-10 12:43:46 +0400
commit2a0213a6d0a9e36a388994445837e051d0bbe5f9 (patch)
treeb7e4d5c2ef5d4061e083ef2123c1fc72ad46d93d /src/keymap.c
parentcb1caeaf2ba26df05e8f9bcd4aa63203cef781fb (diff)
downloademacs-2a0213a6d0a9e36a388994445837e051d0bbe5f9.tar.gz
emacs-2a0213a6d0a9e36a388994445837e051d0bbe5f9.zip
Optimize pure C strings initialization.
* lisp.h (make_pure_string): Fix prototype. (build_pure_c_string): New function, defined as static inline. This provides a better opportunity to optimize away calls to strlen when the function is called with compile-time constant argument. * alloc.c (make_pure_c_string): Fix comment. Change to add nchars argument, adjust users accordingly. Use build_pure_c_string where appropriate. * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c, * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c, * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 234740721ae..cfc1e2e495c 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3705,11 +3705,11 @@ syms_of_keymap (void)
3705 Ffset (intern_c_string ("Control-X-prefix"), control_x_map); 3705 Ffset (intern_c_string ("Control-X-prefix"), control_x_map);
3706 3706
3707 exclude_keys 3707 exclude_keys
3708 = pure_cons (pure_cons (make_pure_c_string ("DEL"), make_pure_c_string ("\\d")), 3708 = pure_cons (pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")),
3709 pure_cons (pure_cons (make_pure_c_string ("TAB"), make_pure_c_string ("\\t")), 3709 pure_cons (pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")),
3710 pure_cons (pure_cons (make_pure_c_string ("RET"), make_pure_c_string ("\\r")), 3710 pure_cons (pure_cons (build_pure_c_string ("RET"), build_pure_c_string ("\\r")),
3711 pure_cons (pure_cons (make_pure_c_string ("ESC"), make_pure_c_string ("\\e")), 3711 pure_cons (pure_cons (build_pure_c_string ("ESC"), build_pure_c_string ("\\e")),
3712 pure_cons (pure_cons (make_pure_c_string ("SPC"), make_pure_c_string (" ")), 3712 pure_cons (pure_cons (build_pure_c_string ("SPC"), build_pure_c_string (" ")),
3713 Qnil))))); 3713 Qnil)))));
3714 staticpro (&exclude_keys); 3714 staticpro (&exclude_keys);
3715 3715