diff options
| author | Dmitry Antipov | 2014-07-08 11:17:04 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-07-08 11:17:04 +0400 |
| commit | f298de5264c86bbb76ccec727779dabe16e6b9c3 (patch) | |
| tree | 05c709251b6982c042f04498510111e0fa03b82e /src/chartab.c | |
| parent | 12dc5429352223f7ba8314d2e16177036a762733 (diff) | |
| download | emacs-f298de5264c86bbb76ccec727779dabe16e6b9c3.tar.gz emacs-f298de5264c86bbb76ccec727779dabe16e6b9c3.zip | |
* chartab.c (char_table_translate): Move to...
* character.h (char_table_translate): ... inline function here.
Avoid Faref and assume that args are always valid. This helps to
speedup search, which is especially important for a huge buffers.
* lisp.h (char_table_translate): Remove prototype.
Diffstat (limited to 'src/chartab.c')
| -rw-r--r-- | src/chartab.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/chartab.c b/src/chartab.c index 3906ad30b37..50be063759a 100644 --- a/src/chartab.c +++ b/src/chartab.c | |||
| @@ -663,19 +663,6 @@ or a character code. Return VALUE. */) | |||
| 663 | return value; | 663 | return value; |
| 664 | } | 664 | } |
| 665 | 665 | ||
| 666 | /* Look up the element in TABLE at index CH, and return it as an | ||
| 667 | integer. If the element is not a character, return CH itself. */ | ||
| 668 | |||
| 669 | int | ||
| 670 | char_table_translate (Lisp_Object table, int ch) | ||
| 671 | { | ||
| 672 | Lisp_Object value; | ||
| 673 | value = Faref (table, make_number (ch)); | ||
| 674 | if (! CHARACTERP (value)) | ||
| 675 | return ch; | ||
| 676 | return XINT (value); | ||
| 677 | } | ||
| 678 | |||
| 679 | static Lisp_Object | 666 | static Lisp_Object |
| 680 | optimize_sub_char_table (Lisp_Object table, Lisp_Object test) | 667 | optimize_sub_char_table (Lisp_Object table, Lisp_Object test) |
| 681 | { | 668 | { |