[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A cleaning-up patch for parse-time.el
From: |
Lars Magne Ingebrigtsen |
Subject: |
Re: A cleaning-up patch for parse-time.el |
Date: |
Fri, 25 Mar 2016 16:24:56 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Marcin Borkowski <address@hidden> writes:
While the patch is obviously correct, parts of it isn't all that useful:
> * lisp/calendar/parse-time.el (parse-time-string-chars)
> (parse-time-tokenize): Make code more readable
[...]
> -(defsubst parse-time-string-chars (char)
> - (cond ((<= ?a char ?z) ?a)
> - ((<= ?0 char ?9) ?0)
> - ((eq char ?+) 1)
> - ((eq char ?-) -1)
> - ((eq char ?:) ?d)))
> +(defsubst parse-time-string-chars (character)
> + "Classify CHARACTER for `parse-time-tokenize'."
> + (cond ((<= ?a character ?z) ?a)
> + ((<= ?0 character ?9) ?0)
> + ((eq character ?+) 1)
> + ((eq character ?-) -1)
> + ((eq character ?:) ?d)))
Using `char' instead of `character' is fine, I think. (See `goto-char'
and a gazillion other usages in the Emacs source code.)
[...]
> - (not (setq c (parse-time-string-chars (aref string index)))))
> + (null (setq c (parse-time-string-chars (aref string index)))))
not vs null isn't very interesting, in my opinion.
> - (setq start index all-digits (eq c ?0))
> + (setq start index
> + all-digits (eq c ?0))
This one makes sense, though (as does the comment fix). I've applied
those bits to the trunk.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Re: A cleaning-up patch for parse-time.el,
Lars Magne Ingebrigtsen <=