MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / LLVM_LIBC_FUNCTION

Function LLVM_LIBC_FUNCTION

system/lib/llvm-libc/src/string/strstr.cpp:20–25  ·  view source on GitHub ↗

TODO: This is a simple brute force implementation. This can be improved upon using well known string matching algorithms.

Source from the content-addressed store, hash-verified

18// TODO: This is a simple brute force implementation. This can be
19// improved upon using well known string matching algorithms.
20LLVM_LIBC_FUNCTION(char *, strstr, (const char *haystack, const char *needle)) {
21 auto comp = [](char l, char r) -> int { return l - r; };
22 LIBC_CRASH_ON_NULLPTR(haystack);
23 LIBC_CRASH_ON_NULLPTR(needle);
24 return inline_strstr(haystack, needle, comp);
25}
26
27} // namespace LIBC_NAMESPACE_DECL

Callers

nothing calls this directly

Calls 1

inline_strstrFunction · 0.85

Tested by

no test coverage detected