From: Philip Kaludercic <philipk@posteo.net>
To: Daniel Mendler <mail@daniel-mendler.de>
Cc: emacs-devel@gnu.org
Subject: Re: [elpa] externals/compat 6a60af22da: Optimize string-search
Date: Fri, 11 Aug 2023 08:17:41 +0000 [thread overview]
Message-ID: <877cq2j8m2.fsf@posteo.net> (raw)
In-Reply-To: <2904fc15-9d4b-448f-08c7-5d438e3f79ff@daniel-mendler.de> (Daniel Mendler's message of "Fri, 11 Aug 2023 09:12:13 +0200")
Daniel Mendler <mail@daniel-mendler.de> writes:
> On 8/11/23 08:07, Philip Kaludercic wrote:
>> ELPA Syncer <elpasync@gnu.org> writes:
>>
>>> branch: externals/compat
>>> commit 6a60af22da1f1a7b08457a4016b9412a475afe4a
>>> Author: Daniel Mendler <mail@daniel-mendler.de>
>>> Commit: Daniel Mendler <mail@daniel-mendler.de>
>>>
>>> Optimize string-search
>>> ---
>>> compat-28.el | 5 ++---
>>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/compat-28.el b/compat-28.el
>>> index fe69315522..b305ab2fff 100644
>>> --- a/compat-28.el
>>> +++ b/compat-28.el
>>> @@ -52,9 +52,8 @@ issues are inherited."
>>> (when (and start-pos (or (< (length haystack) start-pos)
>>> (< start-pos 0)))
>>> (signal 'args-out-of-range (list start-pos)))
>>> - (save-match-data
>>> - (let ((case-fold-search nil))
>>> - (string-match (regexp-quote needle) haystack start-pos))))
>>> + (let (case-fold-search)
>>> + (string-match-p (regexp-quote needle) haystack start-pos)))
>>>
>>> (compat-defun length= (sequence length) ;; [[compat-tests:length=]]
>>> "Returns non-nil if SEQUENCE has a length equal to LENGTH."
>>
>> I don't believe this is a legal optimisation, even if the regular
>> expression is quoted. Consider
>
> Hi Philip,
>
> did you notice that I replaced `string-match' with `string-match-p'?
No, I missed that. Never mind then.
> Daniel
prev parent reply other threads:[~2023-08-11 8:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <169158945793.6388.8459711282582712176@vcs2.savannah.gnu.org>
[not found] ` <20230809135738.457BDC038BF@vcs2.savannah.gnu.org>
2023-08-11 6:07 ` [elpa] externals/compat 6a60af22da: Optimize string-search Philip Kaludercic
2023-08-11 6:23 ` Eli Zaretskii
2023-08-11 8:15 ` Philip Kaludercic
2023-08-11 7:12 ` Daniel Mendler
2023-08-11 8:17 ` Philip Kaludercic [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877cq2j8m2.fsf@posteo.net \
--to=philipk@posteo.net \
--cc=emacs-devel@gnu.org \
--cc=mail@daniel-mendler.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.