diff options
| author | YAMAMOTO Mitsuharu | 2009-06-19 08:39:44 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2009-06-19 08:39:44 +0000 |
| commit | 0e727afa9d1ecb76c8faa96bbfe264aaf4856ffa (patch) | |
| tree | edae48e2baf2b93efed13834ee5b95cc2b536e77 /src/coding.c | |
| parent | 00b9254ce3afe5d8f4a2f5f8e5de138c9a150e89 (diff) | |
| download | emacs-0e727afa9d1ecb76c8faa96bbfe264aaf4856ffa.tar.gz emacs-0e727afa9d1ecb76c8faa96bbfe264aaf4856ffa.zip | |
(Ffind_coding_systems_region_internal): Cache checked characters.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c index e2a328fd908..3fc43df636b 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -8640,7 +8640,7 @@ DEFUN ("find-coding-systems-region-internal", | |||
| 8640 | EMACS_INT start_byte, end_byte; | 8640 | EMACS_INT start_byte, end_byte; |
| 8641 | const unsigned char *p, *pbeg, *pend; | 8641 | const unsigned char *p, *pbeg, *pend; |
| 8642 | int c; | 8642 | int c; |
| 8643 | Lisp_Object tail, elt; | 8643 | Lisp_Object tail, elt, work_table; |
| 8644 | 8644 | ||
| 8645 | if (STRINGP (start)) | 8645 | if (STRINGP (start)) |
| 8646 | { | 8646 | { |
| @@ -8698,6 +8698,7 @@ DEFUN ("find-coding-systems-region-internal", | |||
| 8698 | while (p < pend && ASCII_BYTE_P (*p)) p++; | 8698 | while (p < pend && ASCII_BYTE_P (*p)) p++; |
| 8699 | while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--; | 8699 | while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--; |
| 8700 | 8700 | ||
| 8701 | work_table = Fmake_char_table (Qnil, Qnil); | ||
| 8701 | while (p < pend) | 8702 | while (p < pend) |
| 8702 | { | 8703 | { |
| 8703 | if (ASCII_BYTE_P (*p)) | 8704 | if (ASCII_BYTE_P (*p)) |
| @@ -8705,6 +8706,9 @@ DEFUN ("find-coding-systems-region-internal", | |||
| 8705 | else | 8706 | else |
| 8706 | { | 8707 | { |
| 8707 | c = STRING_CHAR_ADVANCE (p); | 8708 | c = STRING_CHAR_ADVANCE (p); |
| 8709 | if (!NILP (char_table_ref (work_table, c))) | ||
| 8710 | /* This character was already checked. Ignore it. */ | ||
| 8711 | continue; | ||
| 8708 | 8712 | ||
| 8709 | charset_map_loaded = 0; | 8713 | charset_map_loaded = 0; |
| 8710 | for (tail = coding_attrs_list; CONSP (tail);) | 8714 | for (tail = coding_attrs_list; CONSP (tail);) |
| @@ -8736,6 +8740,7 @@ DEFUN ("find-coding-systems-region-internal", | |||
| 8736 | p = pbeg + p_offset; | 8740 | p = pbeg + p_offset; |
| 8737 | pend = pbeg + pend_offset; | 8741 | pend = pbeg + pend_offset; |
| 8738 | } | 8742 | } |
| 8743 | char_table_set (work_table, c, Qt); | ||
| 8739 | } | 8744 | } |
| 8740 | } | 8745 | } |
| 8741 | 8746 | ||