Commit 9248994d authored by Paul Eggert's avatar Paul Eggert
Browse files

* chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.

parent 3befa583
2011-04-09 Paul Eggert <eggert@cs.ucla.edu>
* charset.c (load_charset_map): <, not <=, for optimization.
* chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
* xmenu.c (set_frame_menubar): Allocate smaller local vectors.
This also lets GCC 4.6.0 generate slightly better loop code.
......
......@@ -392,7 +392,8 @@ sub_char_table_set_range (Lisp_Object *table, int depth, int min_char, int from,
*table = val;
else
{
int i, j;
int i;
unsigned j;
depth++;
if (! SUB_CHAR_TABLE_P (*table))
......@@ -403,8 +404,9 @@ sub_char_table_set_range (Lisp_Object *table, int depth, int min_char, int from,
to = max_char;
i = CHARTAB_IDX (from, depth, min_char);
j = CHARTAB_IDX (to, depth, min_char);
j++;
min_char += chartab_chars[depth] * i;
for (; i <= j; i++, min_char += chartab_chars[depth])
for (; i < j; i++, min_char += chartab_chars[depth])
sub_char_table_set_range (XSUB_CHAR_TABLE (*table)->contents + i,
depth, min_char, from, to, val);
}
......@@ -416,16 +418,16 @@ char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val)
{
struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
Lisp_Object *contents = tbl->contents;
int i, min_char;
int i;
if (from == to)
char_table_set (table, from, val);
else
{
for (i = CHARTAB_IDX (from, 0, 0), min_char = i * chartab_chars[0];
min_char <= to;
i++, min_char += chartab_chars[0])
sub_char_table_set_range (contents + i, 0, min_char, from, to, val);
unsigned lim = to / chartab_chars[0] + 1;
for (i = CHARTAB_IDX (from, 0, 0); i < lim; i++)
sub_char_table_set_range (contents + i, 0, i * chartab_chars[0],
from, to, val);
if (ASCII_CHAR_P (from))
tbl->ascii = char_table_ascii (table);
}
......
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