Uses parsed pattern size in pattern scan

Updates the pattern scan loop to iterate over the size of the parsed pattern, ensuring correct iteration when using parsed patterns.
This commit is contained in:
2025-10-05 14:14:31 +03:00
parent 932b0d8deb
commit 7bb23d3f7a

View File

@@ -22,7 +22,7 @@ namespace omath
{
bool found = true;
for (std::ptrdiff_t j = 0; j < static_cast<std::ptrdiff_t>(pattern.size()); j++)
for (std::ptrdiff_t j = 0; j < static_cast<std::ptrdiff_t>(parsed_pattern->size()); j++)
{
found = parsed_pattern->at(j) == std::nullopt || parsed_pattern->at(j) == *(range.data() + i + j);