emacs-devel
[Top][All Lists]
Advanced

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

Re: string-match-p [was Re: [Emacs-diffs] trunk r113149: * ido.el (ido-r


From: Juanma Barranquero
Subject: Re: string-match-p [was Re: [Emacs-diffs] trunk r113149: * ido.el (ido-read-internal): Fix bug#14620.]
Date: Mon, 24 Jun 2013 18:16:25 +0200

On Mon, Jun 24, 2013 at 6:12 PM, Glenn Morris <address@hidden> wrote:

> If I don't care about the match data one way or the other (as here, I
> assume) why is string-match-p preferable? Is it faster or something?

If we consider (as we do) that save-match-data is expensive enough
that we only do when necessary, I'd assume not registering the match
data is faster than registering it, yes.

But anyway, the main reason is legibility. If you encounter
string-match-p or looking-at-p you can be confident that they are
being used as predicates and the following code does not depend on the
match data. That is a net gain IMO.

   J



reply via email to

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