diff options
| author | Paul Eggert | 2011-04-09 13:46:34 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-09 13:46:34 -0700 |
| commit | 3befa583862681a0df1f75274287d1d32f95f7e4 (patch) | |
| tree | b59422f5addb56997954dfc8355a2ae24675a832 /src | |
| parent | e30196164233d058f66efb342eee223f014bf69b (diff) | |
| download | emacs-3befa583862681a0df1f75274287d1d32f95f7e4.tar.gz emacs-3befa583862681a0df1f75274287d1d32f95f7e4.zip | |
* charset.c (load_charset_map): <, not <=, for optimization.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/charset.c | 15 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 084f41fc974..1e2d4fd00af 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2011-04-09 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-04-09 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * charset.c (load_charset_map): <, not <=, for optimization. | ||
| 4 | |||
| 3 | * xmenu.c (set_frame_menubar): Allocate smaller local vectors. | 5 | * xmenu.c (set_frame_menubar): Allocate smaller local vectors. |
| 4 | This also lets GCC 4.6.0 generate slightly better loop code. | 6 | This also lets GCC 4.6.0 generate slightly better loop code. |
| 5 | 7 | ||
diff --git a/src/charset.c b/src/charset.c index 55cbfc4a399..00206cccf0b 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -317,7 +317,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, | |||
| 317 | for (i = 0; i < n_entries; i++) | 317 | for (i = 0; i < n_entries; i++) |
| 318 | { | 318 | { |
| 319 | unsigned from, to; | 319 | unsigned from, to; |
| 320 | int from_index, to_index; | 320 | int from_index, to_index, lim_index; |
| 321 | int from_c, to_c; | 321 | int from_c, to_c; |
| 322 | int idx = i % 0x10000; | 322 | int idx = i % 0x10000; |
| 323 | 323 | ||
| @@ -339,6 +339,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, | |||
| 339 | } | 339 | } |
| 340 | if (from_index < 0 || to_index < 0) | 340 | if (from_index < 0 || to_index < 0) |
| 341 | continue; | 341 | continue; |
| 342 | lim_index = to_index + 1; | ||
| 342 | 343 | ||
| 343 | if (to_c > max_char) | 344 | if (to_c > max_char) |
| 344 | max_char = to_c; | 345 | max_char = to_c; |
| @@ -348,10 +349,10 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, | |||
| 348 | if (control_flag == 1) | 349 | if (control_flag == 1) |
| 349 | { | 350 | { |
| 350 | if (charset->method == CHARSET_METHOD_MAP) | 351 | if (charset->method == CHARSET_METHOD_MAP) |
| 351 | for (; from_index <= to_index; from_index++, from_c++) | 352 | for (; from_index < lim_index; from_index++, from_c++) |
| 352 | ASET (vec, from_index, make_number (from_c)); | 353 | ASET (vec, from_index, make_number (from_c)); |
| 353 | else | 354 | else |
| 354 | for (; from_index <= to_index; from_index++, from_c++) | 355 | for (; from_index < lim_index; from_index++, from_c++) |
| 355 | CHAR_TABLE_SET (Vchar_unify_table, | 356 | CHAR_TABLE_SET (Vchar_unify_table, |
| 356 | CHARSET_CODE_OFFSET (charset) + from_index, | 357 | CHARSET_CODE_OFFSET (charset) + from_index, |
| 357 | make_number (from_c)); | 358 | make_number (from_c)); |
| @@ -360,7 +361,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, | |||
| 360 | { | 361 | { |
| 361 | if (charset->method == CHARSET_METHOD_MAP | 362 | if (charset->method == CHARSET_METHOD_MAP |
| 362 | && CHARSET_COMPACT_CODES_P (charset)) | 363 | && CHARSET_COMPACT_CODES_P (charset)) |
| 363 | for (; from_index <= to_index; from_index++, from_c++) | 364 | for (; from_index < lim_index; from_index++, from_c++) |
| 364 | { | 365 | { |
| 365 | unsigned code = INDEX_TO_CODE_POINT (charset, from_index); | 366 | unsigned code = INDEX_TO_CODE_POINT (charset, from_index); |
| 366 | 367 | ||
| @@ -368,17 +369,17 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, | |||
| 368 | CHAR_TABLE_SET (table, from_c, make_number (code)); | 369 | CHAR_TABLE_SET (table, from_c, make_number (code)); |
| 369 | } | 370 | } |
| 370 | else | 371 | else |
| 371 | for (; from_index <= to_index; from_index++, from_c++) | 372 | for (; from_index < lim_index; from_index++, from_c++) |
| 372 | { | 373 | { |
| 373 | if (NILP (CHAR_TABLE_REF (table, from_c))) | 374 | if (NILP (CHAR_TABLE_REF (table, from_c))) |
| 374 | CHAR_TABLE_SET (table, from_c, make_number (from_index)); | 375 | CHAR_TABLE_SET (table, from_c, make_number (from_index)); |
| 375 | } | 376 | } |
| 376 | } | 377 | } |
| 377 | else if (control_flag == 3) | 378 | else if (control_flag == 3) |
| 378 | for (; from_index <= to_index; from_index++, from_c++) | 379 | for (; from_index < lim_index; from_index++, from_c++) |
| 379 | SET_TEMP_CHARSET_WORK_DECODER (from_c, from_index); | 380 | SET_TEMP_CHARSET_WORK_DECODER (from_c, from_index); |
| 380 | else if (control_flag == 4) | 381 | else if (control_flag == 4) |
| 381 | for (; from_index <= to_index; from_index++, from_c++) | 382 | for (; from_index < lim_index; from_index++, from_c++) |
| 382 | SET_TEMP_CHARSET_WORK_ENCODER (from_c, from_index); | 383 | SET_TEMP_CHARSET_WORK_ENCODER (from_c, from_index); |
| 383 | else /* control_flag == 0 */ | 384 | else /* control_flag == 0 */ |
| 384 | { | 385 | { |