diff options
| author | Lars Ingebrigtsen | 2016-02-28 15:39:33 +1030 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-28 15:39:33 +1030 |
| commit | 5cac11aa0676416432efca82e352938d4d4366f3 (patch) | |
| tree | 90614c40526162a82c35859c7468e522693272c2 | |
| parent | b13cab683c6060e002906fc944680aaa5f4ac123 (diff) | |
| download | emacs-5cac11aa0676416432efca82e352938d4d4366f3.tar.gz emacs-5cac11aa0676416432efca82e352938d4d4366f3.zip | |
Make parse-time-string-chars faster
* lisp/calendar/parse-time.el (parse-time-string-chars): Clean
up the code (backport:).
| -rw-r--r-- | lisp/calendar/parse-time.el | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 4086d236557..6ba26a4a00d 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el | |||
| @@ -41,14 +41,11 @@ | |||
| 41 | (defvar parse-time-val) | 41 | (defvar parse-time-val) |
| 42 | 42 | ||
| 43 | (defsubst parse-time-string-chars (char) | 43 | (defsubst parse-time-string-chars (char) |
| 44 | (save-match-data | 44 | (cond ((<= ?a char ?z) ?a) |
| 45 | (let (case-fold-search str) | 45 | ((<= ?0 char ?9) ?0) |
| 46 | (cond ((eq char ?+) 1) | 46 | ((eq char ?+) 1) |
| 47 | ((eq char ?-) -1) | 47 | ((eq char ?-) -1) |
| 48 | ((eq char ?:) ?d) | 48 | ((eq char ?:) ?d))) |
| 49 | ((string-match "[[:upper:]]" (setq str (string char))) ?A) | ||
| 50 | ((string-match "[[:lower:]]" str) ?a) | ||
| 51 | ((string-match "[[:digit:]]" str) ?0))))) | ||
| 52 | 49 | ||
| 53 | (defun parse-time-tokenize (string) | 50 | (defun parse-time-tokenize (string) |
| 54 | "Tokenize STRING into substrings." | 51 | "Tokenize STRING into substrings." |