Page MenuHomeFreeBSD

lib/libc/amd64/string: implement strpbrk() through strcspn()
ClosedPublic

Authored by fuz on Sep 25 2023, 9:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 13, 9:52 PM
Unknown Object (File)
Thu, Aug 13, 12:51 AM
Unknown Object (File)
Wed, Aug 12, 10:42 PM
Unknown Object (File)
Wed, Aug 12, 10:36 PM
Unknown Object (File)
Tue, Aug 11, 10:48 PM
Unknown Object (File)
Mon, Aug 10, 10:34 AM
Unknown Object (File)
Mon, Aug 10, 10:04 AM
Unknown Object (File)
Mon, Aug 10, 9:55 AM
Subscribers

Details

Summary

This lets us use our optimised strcspn() routine for strpbrk() calls.

In principle, this change could be applied to all architectures
through modification of lib/libc/string/strpbrk.c as strcspn
has a better generic implementation than strpbrk. I have avoided
this as to reduce the impact of these changes. If desired I can
update this DR to do so.

Sponsored by: The FreeBSD Foundation

Test Plan

passes test suite

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable