cut: optimize -f with -d longer than lines

$ time src/cut.before -f1 -dç sl.in >/dev/null
real	0m0.157s

$ time src/cut.after -f1 -dç sl.in >/dev/null
real	0m0.084s
This commit is contained in:
Pádraig Brady committed 2026-04-05 13:15:56 +01:00
1 parent e73dbeb5ab
commit 7a124eb585
1 file changed
+3
+3
View File
@@ -567,6 +567,9 @@ ATTRIBUTE_PURE
static char *
find_bytesearch_field_delim (char *buf, size_t len)
{
if (len < delim_length)
return NULL;
#if ! __GLIBC__ /* Only S390 has optimized memmem on glibc-2.42 */
return memmem (buf, len, delim_bytes, delim_length);
#else