emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at.


From: Juanma Barranquero
Subject: Re: trunk r113818: lisp/xml.el (xml-parse-tag-1): Use looking-at.
Date: Mon, 12 Aug 2013 17:41:15 +0200

On Mon, Aug 12, 2013 at 5:32 PM, Lars Magne Ingebrigtsen <address@hidden> wrote:

>> -         (while (not (looking-at-p end))
>> +         (while (not (looking-at end))
>
> Wouldn't it be better to fix the bogus test instead of changing
> apparently perfectly good code (for the (slightly) worse)?

I'd tend to agree. In this case, an apparent predicate test (even
using (not ...) to reinforce that idea) has a follow-up match-data use
almost 30 lines afterwards; to make things worse,
the code in between (inside (while ...)) also uses string matching
(which does not affect the test, but produces some cognitive load when
reading it). Ugly, I'd say.

> That's the danger of test suites.  >"?

All in all, a small one, against the advantage of having working code ;-)

    J



reply via email to

[Prev in Thread] Current Thread [Next in Thread]