[libc-commits] [PATCH] D147822: [libc] Add memmem implementation

Roland McGrath via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Apr 10 14:03:11 PDT 2023


mcgrathr added inline comments.


================
Comment at: libc/src/string/memory_utils/strstr_implementations.h:17
-template <typename Comp>
-constexpr static char *strstr_implementation(const char *haystack,
-                                             const char *needle, Comp &&comp) {
----------------
It might make sense to keep this around and still call it from strstr, even if strstr_implementation just calls memmem_implementation. An optimized strstr might roll the length determination into the search more efficiently than strlen+memmem so it doesn't seem ideal to have the public entrypoint code assume that strlen+memmem is the implementation you want.




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147822/new/

https://reviews.llvm.org/D147822



More information about the libc-commits mailing list