aboutsummaryrefslogtreecommitdiffstats
path: root/src/font.c
diff options
context:
space:
mode:
authorDmitry Antipov2014-09-22 10:06:19 +0400
committerDmitry Antipov2014-09-22 10:06:19 +0400
commit99c3fad7d44ceced111d8fa1b46d938bd4c67c73 (patch)
tree4860666f44b9de20ac38373336b60e78bbc65053 /src/font.c
parentf135e94e4ecb4c6d3f88c7e028c935c2858f2e02 (diff)
downloademacs-99c3fad7d44ceced111d8fa1b46d938bd4c67c73.tar.gz
emacs-99c3fad7d44ceced111d8fa1b46d938bd4c67c73.zip
Avoid extra call to oblookup when interning symbols.
* lisp.h (intern_driver): Add prototype. * lread.c (intern_driver): New function. (intern1, intern_c_string_1, Fintern): * font.c (font_intern_prop): * w32font.c (intern_font_name): Use it.
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/font.c b/src/font.c
index 57cc4aa0b2b..83860090820 100644
--- a/src/font.c
+++ b/src/font.c
@@ -277,10 +277,8 @@ static int num_font_drivers;
277Lisp_Object 277Lisp_Object
278font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol) 278font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol)
279{ 279{
280 ptrdiff_t i; 280 ptrdiff_t i, nbytes, nchars;
281 Lisp_Object tem; 281 Lisp_Object tem, name, obarray;
282 Lisp_Object obarray;
283 ptrdiff_t nbytes, nchars;
284 282
285 if (len == 1 && *str == '*') 283 if (len == 1 && *str == '*')
286 return Qnil; 284 return Qnil;
@@ -311,12 +309,11 @@ font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol)
311 parse_str_as_multibyte ((unsigned char *) str, len, &nchars, &nbytes); 309 parse_str_as_multibyte ((unsigned char *) str, len, &nchars, &nbytes);
312 tem = oblookup (obarray, str, 310 tem = oblookup (obarray, str,
313 (len == nchars || len != nbytes) ? len : nchars, len); 311 (len == nchars || len != nbytes) ? len : nchars, len);
314
315 if (SYMBOLP (tem)) 312 if (SYMBOLP (tem))
316 return tem; 313 return tem;
317 tem = make_specified_string (str, nchars, len, 314 name = make_specified_string (str, nchars, len,
318 len != nchars && len == nbytes); 315 len != nchars && len == nbytes);
319 return Fintern (tem, obarray); 316 return intern_driver (name, obarray, XINT (tem));
320} 317}
321 318
322/* Return a pixel size of font-spec SPEC on frame F. */ 319/* Return a pixel size of font-spec SPEC on frame F. */