grep: use REG_STARTEND (if available) to speed up regexec
authorBenjamin Kramer <redacted>
Tue, 26 Jan 2010 17:48:36 +0000 (18:48 +0100)
committerJunio C Hamano <redacted>
Tue, 26 Jan 2010 18:44:10 +0000 (10:44 -0800)
commit24072c0256a520408575416fe8706667b576ff99
tree1155e3fcc4cd65d214fc406e1858f95f283d12eb
parente3f67d30b20e49d8fc3eefe819808cba7998b060
grep: use REG_STARTEND (if available) to speed up regexec

BSD and glibc have an extension to regexec which takes a buffer + length pair
instead of a NUL-terminated string. Since we already have the length computed
this can save us a strlen call inside regexec.

Signed-off-by: Benjamin Kramer <redacted>
Acked-by: Linus Torvalds <redacted>
Signed-off-by: Junio C Hamano <redacted>
grep.c
git clone https://git.99rst.org/PROJECT