mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05: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:
parent
fa50bb7209
commit
1ffed412c6
@ -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)
|
static char *linebuf_find(LINEBUF_REC *rec, char chr)
|
||||||
{
|
{
|
||||||
int n;
|
return memchr(rec->str, chr, rec->len);
|
||||||
|
|
||||||
for (n = 0; n < rec->len; n++)
|
|
||||||
if (rec->str[n] == chr) return rec->str+n;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int remove_newline(LINEBUF_REC *rec)
|
static int remove_newline(LINEBUF_REC *rec)
|
||||||
|
Loading…
Reference in New Issue
Block a user