[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inefficient code in reftex-index.el
From: |
Richard Stallman |
Subject: |
Re: Inefficient code in reftex-index.el |
Date: |
Thu, 09 Jun 2005 10:40:19 -0400 |
> Can't you tell that more easily by seeing if match-beginning returns nil?
Which match-beginning?
One for a subexpression inside the alternative you're trying to test for.
After (string-match "\\(a\\)\\|\\(b\\)\\|\\(c\\)" input)
I can just consult (length (match-data)) for distinguishing between
all three alternatives.
You could, but you'd have to compare the value of that against various
constants, which would be ugly. I think this code is cleaner:
(cond ((match-beginning 1)
...)
((match-beginning 2)
...)
((match-beginning 3)
...)
- Re: Inefficient code in reftex-index.el, (continued)
- Re: Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/07
- Re: Inefficient code in reftex-index.el, Richard Stallman, 2005/06/07
- Re: Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/07
- Re: Inefficient code in reftex-index.el, Stefan Monnier, 2005/06/07
- Re: Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/08
- Re: Inefficient code in reftex-index.el, David Kastrup, 2005/06/08
- Re: Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/08
- Re: Inefficient code in reftex-index.el, David Kastrup, 2005/06/08
- Re: Inefficient code in reftex-index.el, Richard Stallman, 2005/06/08
- Re: Inefficient code in reftex-index.el, David Kastrup, 2005/06/08
- Re: Inefficient code in reftex-index.el,
Richard Stallman <=
- Re: Inefficient code in reftex-index.el, David Kastrup, 2005/06/09
- Re: Inefficient code in reftex-index.el, Richard Stallman, 2005/06/10
- Re: Inefficient code in reftex-index.el, David Kastrup, 2005/06/10
- Re: Inefficient code in reftex-index.el, Richard Stallman, 2005/06/07
- Re: Inefficient code in reftex-index.el, David Kastrup, 2005/06/07
- Re: Inefficient code in reftex-index.el, Richard Stallman, 2005/06/08
- Re: Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/07
- Re: Inefficient code in reftex-index.el, Stefan Monnier, 2005/06/07
- Re: Inefficient code in reftex-index.el, Richard Stallman, 2005/06/08
- Re: Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/08