Make include, exclude, count prefixes NOT substring matches (#670)

This commit is contained in:
Darrell 2022-09-12 18:35:30 -04:00 committed by GitHub
parent b8a06a7f80
commit 05b37ba7ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -650,7 +650,7 @@ bool BleFingerprint::shouldCount()
bool prevCounting = counting;
if (ignore || !countable || !hasValue)
counting = false;
else if (getMsSinceFirstSeen() <= BleFingerprintCollection::countMs || getMsSinceLastSeen() > BleFingerprintCollection::countMs)
else if (getMsSinceLastSeen() > BleFingerprintCollection::countMs)
counting = false;
else if (counting && output.value.position > BleFingerprintCollection::countExit)
counting = false;

View File

@ -125,12 +125,12 @@ bool prefixExists(const String &prefixes, const String &s)
if (space > start)
{
auto sub = prefixes.substring(start, space);
if (s.indexOf(sub) != -1) return true;
if (s.indexOf(sub) == 0) return true;
}
start = space + 1;
}
auto sub = prefixes.substring(start);
return !sub.isEmpty() && s.indexOf(sub) != -1;
return !sub.isEmpty() && s.indexOf(sub) == 0;
}
bool spurt(const String &fn, const String &content)