mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-30 05:40:58 +01:00
users/19059 based on users/19058: remove ineffiency with multiple * matches
This commit is contained in:
parent
956829c18e
commit
8bf3595e3a
3 changed files with 23 additions and 0 deletions
|
|
@ -3012,6 +3012,16 @@ patmatch(Upat prog)
|
|||
break;
|
||||
case P_STAR:
|
||||
/* Handle specially for speed, although really P_ONEHASH+P_ANY */
|
||||
while (P_OP(next) == P_STAR) {
|
||||
/*
|
||||
* If there's another * following we can optimise it
|
||||
* out. Chains of *'s can give pathologically bad
|
||||
* performance.
|
||||
*/
|
||||
scan = next;
|
||||
next = PATNEXT(scan);
|
||||
}
|
||||
/*FALLTHROUGH*/
|
||||
case P_ONEHASH:
|
||||
case P_TWOHASH:
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue