Fix a bug in UnorderedEqualsMatcher

Previously a mismatched prefix would be skipped before the actual
comparison would be performed. Obviously, it is supposed to be
_matching_ prefix that is skipped.
This commit is contained in:
Martin Hořeňovský
2018-09-28 15:30:00 +02:00
parent 558bbe7d24
commit be49a539e4
7 changed files with 42 additions and 8 deletions

View File

@@ -124,7 +124,7 @@ namespace Matchers {
auto lfirst = m_target.begin(), llast = m_target.end();
auto rfirst = vec.begin(), rlast = vec.end();
// Cut common prefix to optimize checking of permuted parts
while (lfirst != llast && *lfirst != *rfirst) {
while (lfirst != llast && *lfirst == *rfirst) {
++lfirst; ++rfirst;
}
if (lfirst == llast) {