We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 846e0e5 commit 484caf1Copy full SHA for 484caf1
1 file changed
src/scorepy/cstring.h
@@ -36,12 +36,12 @@ class CString
36
/// Find the first occurrence of the character and return a pointer to it or NULL if not found
37
const char* find(char c) const
38
{
39
- return std::strchr(s_, c);
+ return static_cast<const char*>(std::memchr(s_, c, len_));
40
}
41
template <size_t N>
42
bool starts_with(const char (&prefix)[N]) const
43
44
- return (len_ >= N - 1u) && (std::strncmp(s_, prefix, N - 1u) == 0);
+ return (len_ >= N - 1u) && (std::memcmp(s_, prefix, N - 1u) == 0);
45
46
47
friend bool operator==(const CString& lhs, const CString& rhs)
0 commit comments