TODO: This is a simple brute force implementation. This can be improved upon using well known string matching algorithms.
| 18 | // TODO: This is a simple brute force implementation. This can be |
| 19 | // improved upon using well known string matching algorithms. |
| 20 | LLVM_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 |
nothing calls this directly
no test coverage detected