From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: replacement slowdown
Date: Sun, 24 Apr 2005 16:46:43 +0000 [thread overview]
Message-ID: <1050424164643.ZM5802@candle.brasslantern.com> (raw)
In-Reply-To: <1050424033218.ZM24729@candle.brasslantern.com>
On Apr 24, 3:32am, Bart Schaefer wrote:
}
} I agree Peter's solution is simpler, but I think it ought to get merged
} with my extra METAINC()s and related changes.
Here's that patch:
Index: Src/glob.c
--- ../zsh-forge/current/Src/glob.c Sun Apr 24 09:22:59 2005
+++ Src/glob.c Sun Apr 24 09:41:32 2005
@@ -2293,6 +2293,8 @@
* There's no optimization here. */
for (ioff = uml, t = s + l, umlen = 0; t >= s;
t--, ioff--, umlen++) {
+ if (t > s && t[-1] == Meta)
+ t--;
set_pat_start(p, t-s);
if (pattrylen(p, t, s + l - t, umlen, ioff)) {
*sp = get_match_ret(*sp, t - s, l, fl, replstr);
@@ -2308,7 +2310,7 @@
* move forward along string until we get a match. *
* Again there's no optimisation. */
for (ioff = 0, t = s, umlen = uml; t < s + l;
- ioff++, t++, umlen--) {
+ ioff++, METAINC(t), umlen--) {
set_pat_start(p, t-s);
if (pattrylen(p, t, s + l - t, umlen, ioff)) {
*sp = get_match_ret(*sp, t-s, l, fl, replstr);
@@ -2336,7 +2338,7 @@
do {
/* loop over all matches for global substitution */
matched = 0;
- for (; t < s + l; t++, ioff++, umlen--) {
+ for (; t < s + l; METAINC(t), ioff++, umlen--) {
/* Find the longest match from this position. */
set_pat_start(p, t-s);
if (pattrylen(p, t, s + l - t, umlen, ioff)) {
next prev parent reply other threads:[~2005-04-24 16:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-22 23:23 Clint Adams
2005-04-23 3:14 ` Bart Schaefer
2005-04-23 3:19 ` Clint Adams
2005-04-23 16:07 ` Bart Schaefer
2005-04-23 16:26 ` Clint Adams
2005-04-23 17:12 ` Bart Schaefer
2005-04-24 0:33 ` Peter Stephenson
2005-04-24 0:47 ` PATCH: " Bart Schaefer
2005-04-24 3:32 ` Bart Schaefer
2005-04-24 16:46 ` Bart Schaefer [this message]
2005-04-23 16:25 ` Bart Schaefer
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=1050424164643.ZM5802@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.dk \
/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 public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).