changeset 99475:98e08333a580

(Fget_byte): Fix and make it faster for unibyte target.
author Kenichi Handa <handa@m17n.org>
date Mon, 10 Nov 2008 00:45:26 +0000
parents ecad25300f20
children d4466eff6f46
files src/character.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/character.c	Sun Nov 09 21:22:41 2008 +0000
+++ b/src/character.c	Mon Nov 10 00:45:26 2008 +0000
@@ -1058,6 +1058,8 @@
 	  pos = XFASTINT (position);
 	  p = CHAR_POS_ADDR (pos);
 	}
+      if (NILP (current_buffer->enable_multibyte_characters))
+	return make_number (*p);
     }
   else
     {
@@ -1074,6 +1076,8 @@
 	  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))