1
0
Fork 0
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:
Peter Stephenson 2014-09-08 16:38:51 +01:00
parent 956829c18e
commit 8bf3595e3a
3 changed files with 23 additions and 0 deletions

View file

@ -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:
/*