From: Lars Ingebrigtsen Date: Sun, 28 Feb 2016 05:09:33 +0000 (+1030) Subject: Make parse-time-string-chars faster X-Git-Tag: emacs-25.0.92~24 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5cac11aa0676416432efca82e352938d4d4366f3;p=emacs.git Make parse-time-string-chars faster * lisp/calendar/parse-time.el (parse-time-string-chars): Clean up the code (backport:). --- 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 @@ (defvar parse-time-val) (defsubst parse-time-string-chars (char) - (save-match-data - (let (case-fold-search str) - (cond ((eq char ?+) 1) - ((eq char ?-) -1) - ((eq char ?:) ?d) - ((string-match "[[:upper:]]" (setq str (string char))) ?A) - ((string-match "[[:lower:]]" str) ?a) - ((string-match "[[:digit:]]" str) ?0))))) + (cond ((<= ?a char ?z) ?a) + ((<= ?0 char ?9) ?0) + ((eq char ?+) 1) + ((eq char ?-) -1) + ((eq char ?:) ?d))) (defun parse-time-tokenize (string) "Tokenize STRING into substrings."