changeset 91036:f5e7e4e0fa66

(map_sub_char_table): If the range contains just one character, call the function with that character even if the depth is not 3. (map_char_table): Likewise.
author Kenichi Handa <handa@m17n.org>
date Thu, 20 Sep 2007 07:49:52 +0000
parents eec5de3521b8
children fd549372af1b
files src/chartab.c
diffstat 1 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/chartab.c	Wed Sep 19 13:59:16 2007 +0000
+++ b/src/chartab.c	Thu Sep 20 07:49:52 2007 +0000
@@ -805,8 +805,7 @@
 	      if (! NILP (val) && different_value)
 		{
 		  XSETCDR (range, make_number (c - 1));
-		  if (depth == 3
-		      && EQ (XCAR (range), XCDR (range)))
+		  if (EQ (XCAR (range), XCDR (range)))
 		    {
 		      if (c_function)
 			(*c_function) (arg, XCAR (range), val);
@@ -875,10 +874,20 @@
 
   if (! NILP (val))
     {
-      if (c_function)
-	(*c_function) (arg, range, val);
+      if (EQ (XCAR (range), XCDR (range)))
+	{
+	  if (c_function)
+	    (*c_function) (arg, XCAR (range), val);
+	  else
+	    call2 (function, XCAR (range), val);
+	}
       else
-	call2 (function, range, val);
+	{
+	  if (c_function)
+	    (*c_function) (arg, range, val);
+	  else
+	    call2 (function, range, val);
+	}
     }
 
   UNGCPRO;