From: Frédéric Marchal Date: Sat, 20 Mar 2010 18:08:25 +0000 (+0000) Subject: Speed up a bit the reading of the files X-Git-Tag: v2.3-pre2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a0a624b99341bf919c7f205af4fc1c8cbd735db;p=thirdparty%2Fsarg.git Speed up a bit the reading of the files --- diff --git a/longline.c b/longline.c index 04aceb4..9ef816d 100644 --- a/longline.c +++ b/longline.c @@ -92,7 +92,11 @@ char *longline_read(FILE *fp_in,longline line) line->start=line->end; while (true) { - for (i=line->end ; ilength && line->buffer[i]!='\n' && line->buffer[i]!='\r' ; i++); + for (i=line->end ; ilength ; i++) { + if ((unsigned char)line->buffer[i]>=' ') continue; + if (line->buffer[i]=='\n' || line->buffer[i]=='\r') break; + } + line->end=i; if (line->endlength) break;