From 1ffed412c662f2fb3cdb0bc56a5f55bd127aceb2 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Sun, 30 Mar 2008 13:23:12 +0000 Subject: [PATCH] Implement linebuf_find using memchr. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4788 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/line-split.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/core/line-split.c b/src/core/line-split.c index b100a20f..a93ce8e8 100644 --- a/src/core/line-split.c +++ b/src/core/line-split.c @@ -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)