From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carsten Dominik Newsgroups: gmane.emacs.devel Subject: Re: Inefficient code in reftex-index.el Date: Mon, 6 Jun 2005 16:41:06 +0200 Message-ID: <17060.24706.245710.106599@sam.science.uva.nl> References: <85slzv7j87.fsf@lola.goethe.zz> Reply-To: Carsten Dominik NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1118070747 8272 80.91.229.2 (6 Jun 2005 15:12:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2005 15:12:27 +0000 (UTC) Cc: Carsten Dominik , emacs-devel@gnu.org, "Kim F. Storm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 06 17:12:22 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DfJDl-00058c-Bl for ged-emacs-devel@m.gmane.org; Mon, 06 Jun 2005 17:08:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DfJK5-00080y-Sa for ged-emacs-devel@m.gmane.org; Mon, 06 Jun 2005 11:15:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DfJ4g-00024E-Lh for emacs-devel@gnu.org; Mon, 06 Jun 2005 10:59:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DfJ4e-00022i-J1 for emacs-devel@gnu.org; Mon, 06 Jun 2005 10:59:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DfJ4c-0001gO-Pw for emacs-devel@gnu.org; Mon, 06 Jun 2005 10:59:30 -0400 Original-Received: from [146.50.4.51] (helo=imap.science.uva.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DfIq1-0004da-J0; Mon, 06 Jun 2005 10:44:25 -0400 Original-Received: from sam.science.uva.nl [146.50.10.135] by imap.science.uva.nl with ESMTP (sendmail 8.11.6p2/config 11.35). id j56Ef6k22876; Mon, 6 Jun 2005 16:41:06 +0200 X-Organisation: Faculty of Science, University of Amsterdam, The Netherlands X-URL: http://www.science.uva.nl/ Original-Received: by sam.science.uva.nl (Postfix, from userid 11669) id 5B93517886; Mon, 6 Jun 2005 16:41:06 +0200 (CEST) Original-To: David Kastrup In-Reply-To: <85slzv7j87.fsf@lola.goethe.zz> X-Mailer: VM 7.19 under Emacs 21.3.1 X-Virus-Scanned: by amavisd-new X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:38187 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38187 >>>>> "DK" == David Kastrup writes: DK> storm@cua.dk (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. DK> That is not the same: the above will set beg and end to markers, DK> whereas match-beginning/match-end happen to be integers. Yes, indeed markers are needed here. I will change it like Stafan proposed it. Thanks for picking this up, Kim. I don't understand your ironic reply to Davids email. Entirely unnecessary. - Carsten -- Carsten Dominik \ _ / Sterrenkundig Instituut "Anton Pannekoek" |X| _ Kruislaan 403; NL-1098 SJ Amsterdam /| |\ _ _ _/ \ phone +31 (20) 525-7477; FAX +31 (20) 525-7484 __|o|___/ ~~ \___/ ~~~