fix(baseN): isValid(): rewrited on string_view

This commit is contained in:
2024-09-13 13:40:57 +03:00
parent 97e714fba0
commit 4bba05f991

View File

@ -8,14 +8,13 @@ namespace baseN
{
bool isValid(const char *str, const int8_t *map) noexcept
{
uint64_t i = 0;
while (str[i] != '\0')
std::string_view sv(str);
for (size_t i = 0; i < sv.size(); i++)
{
if (map[(int8_t)str[i]] == -1)
{
return false;
}
i++;
}
return true;
}