HomeFreeBSD

daemon: replace memchr with memrchr

Description

daemon: replace memchr with memrchr

Looping over lines in the buffer is not needed.
Same effect can be achieved by looking for the last new line.
If found the buffer is guaranteed to have one or more complete lines.
All complete lines are flushed at once with no looping.

Reviewed by: cperciva, kevans

Details

Provenance
ihor_antonovs.familyAuthored on Dec 27 2023, 6:07 AM
kevansCommitted on Dec 27 2023, 6:07 AM
Parents
rG24fd3e969ebe: daemon: move buffer into daemon_state
Branches
Unknown
Tags
Unknown