[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inefficient code in reftex-index.el
From: |
David Kastrup |
Subject: |
Re: Inefficient code in reftex-index.el |
Date: |
Mon, 06 Jun 2005 14:39:04 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
address@hidden (Kim F. Storm) writes:
> I noticed the following code in reftex-index.el:
>
> (condition-case nil (texmathp) (error nil))))
> (setq beg (car (match-data))
> end (nth 1 (match-data)))
>
> Using match-data like that seems inefficient.
>
> I suggtest using match-beginning/match-end instead.
That is not the same: the above will set beg and end to markers,
whereas match-beginning/match-end happen to be integers. However, the
above will also create markers that are unused, so it would be saner
to call (match-data) only once _if_ indeed markers are what is
required.
Unused markers slow done editing operations afterwards. So even if
markers _are_ what is wanted for some reason, they should be
explicitly unseated with set-marker once they are no longer needed.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
- Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/06
- Re: Inefficient code in reftex-index.el,
David Kastrup <=
- Re: Inefficient code in reftex-index.el, Stefan Monnier, 2005/06/06
- Re: Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/06
- Re: Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/06
- Re: Inefficient code in reftex-index.el, David Kastrup, 2005/06/06
- Re: Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/07
- Re: Inefficient code in reftex-index.el, David Kastrup, 2005/06/07
- Re: Inefficient code in reftex-index.el, Kim F. Storm, 2005/06/07
- Re: Inefficient code in reftex-index.el, David Kastrup, 2005/06/07