1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-19 12:07:13 +01:00

Fix incorrect size check in entity search algorithms.

This commit is contained in:
Sandu Liviu Catalin 2016-06-21 17:44:21 +03:00
parent b4bfced27b
commit cb82a98bf6

View File

@ -65,7 +65,7 @@ void EachBegins(Iterator first, Iterator last,
// Retrieve the string
const auto & s = retrieve(*first);
// Compare the string
if (s.size() > len && (s.compare(0, len, str) == 0) == neg)
if (s.size() >= len && (s.compare(0, len, str) == 0) == neg)
{
collect(*first);
}
@ -90,7 +90,7 @@ void EachEnds(Iterator first, Iterator last,
// Retrieve the string
const auto & s = retrieve(*first);
// Compare the tag
if (s.size() > len && (s.compare(s.size() - len, len, str) == 0) == neg)
if (s.size() >= len && (s.compare(s.size() - len, len, str) == 0) == neg)
{
collect(*first);
}
@ -151,7 +151,7 @@ void FirstBegins(Iterator first, Iterator last,
// Retrieve the string
const auto & s = retrieve(*first);
// Compare the string
if (s.size() > len && (s.compare(0, len, str) == 0) == neg)
if (s.size() >= len && (s.compare(0, len, str) == 0) == neg)
{
receive(*first);
break;
@ -177,7 +177,7 @@ void FirstEnds(Iterator first, Iterator last,
// Retrieve the string
const auto & s = retrieve(*first);
// Compare the string
if (s.size() > len && (s.compare(s.size() - len, len, str) == 0) == neg)
if (s.size() >= len && (s.compare(s.size() - len, len, str) == 0) == neg)
{
receive(*first);
break;