1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-09 06:20:45 +00:00

Implement linebuf_find using memchr.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4788 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2008-03-30 13:23:12 +00:00 committed by exg
parent fa50bb7209
commit 1ffed412c6

View File

@ -53,12 +53,7 @@ static void linebuf_append(LINEBUF_REC *rec, const char *data, int len)
static char *linebuf_find(LINEBUF_REC *rec, char chr)
{
int n;
for (n = 0; n < rec->len; n++)
if (rec->str[n] == chr) return rec->str+n;
return NULL;
return memchr(rec->str, chr, rec->len);
}
static int remove_newline(LINEBUF_REC *rec)