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)
|
if (target.size() > m_size)
|
||||||
return false;
|
return false;
|
||||||
for (size_type i = 0; i < m_size - target.size(); i++)
|
for (size_type i = 0; i < target.size(); i++)
|
||||||
{
|
if (m_data[i] != target[i])
|
||||||
bool valid = true;
|
return false;
|
||||||
for (size_type j = 0; j < target.size() && valid; j++)
|
return true;
|
||||||
valid = (m_data[i + j] == target[j]);
|
|
||||||
if (valid)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool contains(char ch) const
|
constexpr bool contains(char ch) const
|
||||||
|
|
Loading…
Reference in New Issue