forked from Bananymous/banan-os
BAN: Fix StringView::starts_with
I have no idea what i had been thinking when writing this code :D
This commit is contained in:
parent
4f3c05851c
commit
6f90974896
|
@ -186,15 +186,10 @@ namespace BAN
|
|||
{
|
||||
if (target.size() > m_size)
|
||||
return false;
|
||||
for (size_type i = 0; i < m_size - target.size(); i++)
|
||||
{
|
||||
bool valid = true;
|
||||
for (size_type j = 0; j < target.size() && valid; j++)
|
||||
valid = (m_data[i + j] == target[j]);
|
||||
if (valid)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
for (size_type i = 0; i < target.size(); i++)
|
||||
if (m_data[i] != target[i])
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
constexpr bool contains(char ch) const
|
||||
|
|
Loading…
Reference in New Issue