AK: Use memchr for StringView::contains()
This commit is contained in:
parent
381910a51d
commit
4115803fd9
1 changed files with 1 additions and 5 deletions
|
|
@ -165,11 +165,7 @@ bool StringView::matches(StringView mask, CaseSensitivity case_sensitivity) cons
|
|||
|
||||
bool StringView::contains(char needle) const
|
||||
{
|
||||
for (char current : *this) {
|
||||
if (current == needle)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return memchr(m_characters, static_cast<unsigned char>(needle), m_length) != nullptr;
|
||||
}
|
||||
|
||||
bool StringView::contains(u32 needle) const
|
||||
|
|
|
|||
Loading…
Reference in a new issue