From: Kenichi Handa Date: Tue, 8 Sep 1998 02:01:59 +0000 (+0000) Subject: (Ffind_charset_region): Optimization for unibyte buffer. X-Git-Tag: emacs-20.4~1739 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2e45bf18010af1c55dda850afb325284e367d1e9;p=emacs.git (Ffind_charset_region): Optimization for unibyte buffer. (Ffind_charset_string): For unibyte string, return (ascii). --- diff --git a/src/charset.c b/src/charset.c index 55cfe717d3d..9cafe3ebcf8 100644 --- a/src/charset.c +++ b/src/charset.c @@ -798,6 +798,11 @@ Optional arg TABLE if non-nil is a translation table to look up.") from = XFASTINT (beg); stop = to = XFASTINT (end); + if (NILP (current_buffer->enable_multibyte_characters)) + return (from == to + ? Qnil + : Fcons (Qascii, Qnil)); + if (from < GPT && GPT < to) { stop = GPT; @@ -843,7 +848,9 @@ Optional arg TABLE if non-nil is a translation table to look up.") CHECK_STRING (str, 0); if (! STRING_MULTIBYTE (str)) - return Qnil; + return (XSTRING (str)->size == 0 + ? Qnil + : Fcons (Qascii, Qnil)); bzero (charsets, (MAX_CHARSET + 1) * sizeof (int)); find_charset_in_str (XSTRING (str)->data, STRING_BYTES (XSTRING (str)),