summaryrefslogtreecommitdiffstats
path: root/usr.bin/grep/fastgrep.c
diff options
context:
space:
mode:
authorgabor <gabor@FreeBSD.org>2010-08-18 17:40:10 +0000
committergabor <gabor@FreeBSD.org>2010-08-18 17:40:10 +0000
commitfb7d7246f68844fc4062c081c8cab78a7a9320db (patch)
tree31c9b1f57fe3aca149aa8365f6e17a9bb8f206fb /usr.bin/grep/fastgrep.c
parent82e4bb536ac304054c6d49d74651f89b7846106d (diff)
downloadFreeBSD-src-fb7d7246f68844fc4062c081c8cab78a7a9320db.zip
FreeBSD-src-fb7d7246f68844fc4062c081c8cab78a7a9320db.tar.gz
- Refactor file reading code to use pure syscalls and an internal buffer
instead of stdio. This gives BSD grep a very big performance boost, its speed is now almost comparable to GNU grep. Submitted by: Dimitry Andric <dimitry@andric.com> Approved by: delphij (mentor)
Diffstat (limited to 'usr.bin/grep/fastgrep.c')
-rw-r--r--usr.bin/grep/fastgrep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/grep/fastgrep.c b/usr.bin/grep/fastgrep.c
index c66f0a7..30a2dc5 100644
--- a/usr.bin/grep/fastgrep.c
+++ b/usr.bin/grep/fastgrep.c
@@ -198,7 +198,7 @@ fastcomp(fastgrep_t *fg, const char *pat)
}
int
-grep_search(fastgrep_t *fg, unsigned char *data, size_t len, regmatch_t *pmatch)
+grep_search(fastgrep_t *fg, const unsigned char *data, size_t len, regmatch_t *pmatch)
{
unsigned int j;
int ret = REG_NOMATCH;
OpenPOWER on IntegriCloud