efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
2011-03-27 Paul Eggert <eggert@cs.ucla.edu>
+ * chartab.c (sub_char_table_ref_and_range): Redo for slight
+ efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
+
* keyboard.c, keyboard.h (num_input_events): Now size_t.
This avoids undefined behavior on integer overflow, and is a bit
more convenient anyway since it is compared to a size_t variable.
struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
int depth = XINT (tbl->depth);
int min_char = XINT (tbl->min_char);
- int max_char = min_char + chartab_chars[depth - 1] - 1;
int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx;
Lisp_Object val;
break;
}
}
- while ((c = min_char + (chartab_idx + 1) * chartab_chars[depth]) <= max_char
- && *to >= c)
+ while (((c = (chartab_idx + 1) * chartab_chars[depth])
+ < chartab_chars[depth - 1])
+ && (c += min_char) <= *to)
{
Lisp_Object this_val;