From d5998e0317c1f425d1de83934891cb2340ec10e4 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 10 Nov 2008 00:47:08 +0000 Subject: [PATCH] (Fget_byte): Fix and make it faster for unibyte target. --- src/ChangeLog | 5 +++++ src/character.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index d96d8b29459..71da2e8b06f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-11-10 Kenichi Handa + + * character.c (Fget_byte): Fix and make it faster for unibyte + target. + 2008-11-08 Chong Yidong * dired.c (file_name_completion): If completion_ignore_case is diff --git a/src/character.c b/src/character.c index 38d4f6ac510..66e1b023919 100644 --- a/src/character.c +++ b/src/character.c @@ -1058,6 +1058,8 @@ character is not ASCII nor 8-bit character, an error is signalled. */) pos = XFASTINT (position); p = CHAR_POS_ADDR (pos); } + if (NILP (current_buffer->enable_multibyte_characters)) + return make_number (*p); } else { @@ -1074,6 +1076,8 @@ character is not ASCII nor 8-bit character, an error is signalled. */) pos = XFASTINT (position); p = SDATA (string) + string_char_to_byte (string, pos); } + if (! STRING_MULTIBYTE (string)) + return make_number (*p); } c = STRING_CHAR (p, 0); if (CHAR_BYTE8_P (c)) -- 2.39.2