Compare commits
2 Commits
105ed79f8f
...
7f990b161b
Author | SHA1 | Date | |
---|---|---|---|
7f990b161b | |||
9bb3fed611 |
@ -81,7 +81,8 @@ extern "C"
|
|||||||
a++;
|
a++;
|
||||||
b++;
|
b++;
|
||||||
}
|
}
|
||||||
return *(const u8*)a - *(const u8*)b;
|
static_assert(sizeof(wchar_t) == sizeof(u32));
|
||||||
|
return *(const u32*)a - *(const u32*)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
int strncmp(const char* a, const char* b, usize max)
|
int strncmp(const char* a, const char* b, usize max)
|
||||||
|
@ -50,12 +50,14 @@ const char& StringView::operator[](usize index) const
|
|||||||
|
|
||||||
bool StringView::operator==(const char* other) const
|
bool StringView::operator==(const char* other) const
|
||||||
{
|
{
|
||||||
return !strcmp(m_string, other);
|
if (m_length != strlen(other)) return false;
|
||||||
|
return !strncmp(m_string, other, m_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StringView::operator==(StringView other) const
|
bool StringView::operator==(StringView other) const
|
||||||
{
|
{
|
||||||
return !strcmp(m_string, other.m_string);
|
if (m_length != other.m_length) return false;
|
||||||
|
return !strncmp(m_string, other.m_string, m_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<Vector<String>> StringView::split(StringView delim) const
|
Result<Vector<String>> StringView::split(StringView delim) const
|
||||||
|
Loading…
Reference in New Issue
Block a user