diff options
| author | Stefan Kangas | 2023-10-29 01:40:25 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2023-10-29 01:40:25 +0200 |
| commit | 3624e9bd409075d4f78b240ebdb356f93fd9c3e4 (patch) | |
| tree | 8f98f03143f642fb2a61a5164b3025c0b8a80f96 /lisp/language | |
| parent | e08238cdd74719d4cd99cf5a4f743eb8c6d1d251 (diff) | |
| download | emacs-3624e9bd409075d4f78b240ebdb356f93fd9c3e4.tar.gz emacs-3624e9bd409075d4f78b240ebdb356f93fd9c3e4.zip | |
Prefer seq-filter in hanja-util.el
Benchmarking shows seq-filter to be ~30% faster on this machine.
* lisp/language/hanja-util.el (hanja-filter): Make into obsolete alias
for 'seq-filter'. Update single caller.
Diffstat (limited to 'lisp/language')
| -rw-r--r-- | lisp/language/hanja-util.el | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lisp/language/hanja-util.el b/lisp/language/hanja-util.el index be0364b1c23..b5ef9230d27 100644 --- a/lisp/language/hanja-util.el +++ b/lisp/language/hanja-util.el | |||
| @@ -6479,11 +6479,7 @@ character. This variable is initialized by `hanja-init-load'.") | |||
| 6479 | map) | 6479 | map) |
| 6480 | "Keymap for Hanja (Korean Hanja Converter).") | 6480 | "Keymap for Hanja (Korean Hanja Converter).") |
| 6481 | 6481 | ||
| 6482 | (defun hanja-filter (condp lst) | 6482 | (define-obsolete-function-alias 'hanja-filter #'seq-filter "30.1") |
| 6483 | "Construct a list from the elements of LST for which CONDP returns true." | ||
| 6484 | (delq | ||
| 6485 | nil | ||
| 6486 | (mapcar (lambda (x) (and (funcall condp x) x)) lst))) | ||
| 6487 | 6483 | ||
| 6488 | (defun hanja-list-prev-group () | 6484 | (defun hanja-list-prev-group () |
| 6489 | "Select the previous group of hangul->hanja conversions." | 6485 | "Select the previous group of hangul->hanja conversions." |
| @@ -6570,12 +6566,12 @@ The value is a hanja character that is selected interactively." | |||
| 6570 | 0 0 | 6566 | 0 0 |
| 6571 | ;; Filter characters that can not be decoded. | 6567 | ;; Filter characters that can not be decoded. |
| 6572 | ;; Maybe it can not represent characters in current terminal coding. | 6568 | ;; Maybe it can not represent characters in current terminal coding. |
| 6573 | (hanja-filter (lambda (x) (car x)) | 6569 | (seq-filter #'car |
| 6574 | (mapcar (lambda (c) | 6570 | (mapcar (lambda (c) |
| 6575 | (if (listp c) | 6571 | (if (listp c) |
| 6576 | (cons (car c) (cdr c)) | 6572 | (cons (car c) (cdr c)) |
| 6577 | (list c))) | 6573 | (list c))) |
| 6578 | (aref hanja-table char))))) | 6574 | (aref hanja-table char))))) |
| 6579 | (unwind-protect | 6575 | (unwind-protect |
| 6580 | (when (aref hanja-conversions 2) | 6576 | (when (aref hanja-conversions 2) |
| 6581 | (catch 'exit-input-loop | 6577 | (catch 'exit-input-loop |