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

Roland McGrath via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Apr 11 12:51:02 PDT 2023


mcgrathr added inline comments.


================
Comment at: libc/src/string/memmem.cpp:18
+                    const void *needle, size_t needle_len)) {
+  auto comp = [](char l, char r) -> int { return l - r; };
+  return memmem_implementation(haystack, haystack_len, needle, needle_len,
----------------
mcgrathr wrote:
> Can be constexpr.
If this is intended as an ordering comparison and not just equality, then generally `unsigned char` should be used.



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