Commit 2e45bf18 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(Ffind_charset_region): Optimization for unibyte buffer.

(Ffind_charset_string): For unibyte string, return (ascii).
parent 21a003b9
...@@ -798,6 +798,11 @@ Optional arg TABLE if non-nil is a translation table to look up.") ...@@ -798,6 +798,11 @@ Optional arg TABLE if non-nil is a translation table to look up.")
from = XFASTINT (beg); from = XFASTINT (beg);
stop = to = XFASTINT (end); stop = to = XFASTINT (end);
if (NILP (current_buffer->enable_multibyte_characters))
return (from == to
? Qnil
: Fcons (Qascii, Qnil));
if (from < GPT && GPT < to) if (from < GPT && GPT < to)
{ {
stop = GPT; stop = GPT;
...@@ -843,7 +848,9 @@ Optional arg TABLE if non-nil is a translation table to look up.") ...@@ -843,7 +848,9 @@ Optional arg TABLE if non-nil is a translation table to look up.")
CHECK_STRING (str, 0); CHECK_STRING (str, 0);
if (! STRING_MULTIBYTE (str)) if (! STRING_MULTIBYTE (str))
return Qnil; return (XSTRING (str)->size == 0
? Qnil
: Fcons (Qascii, Qnil));
bzero (charsets, (MAX_CHARSET + 1) * sizeof (int)); bzero (charsets, (MAX_CHARSET + 1) * sizeof (int));
find_charset_in_str (XSTRING (str)->data, STRING_BYTES (XSTRING (str)), find_charset_in_str (XSTRING (str)->data, STRING_BYTES (XSTRING (str)),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment