system: fix view comparison

note that it is equality, not byte comparison based on
memcmp or strcmp return values
This commit is contained in:
Maxim Prokhorov
2022-09-21 02:36:56 +03:00
parent 009d1b0014
commit 7fc8ccdf72
3 changed files with 9 additions and 7 deletions

View File

@@ -8,7 +8,7 @@
namespace espurna {
// no special cases for flash strings
bool StringView::compare(espurna::StringView other) const {
bool StringView::equals(espurna::StringView other) const {
return _ptr == other._ptr
|| (_len == other._len && (0 == __builtin_memcmp(_ptr, other._ptr, _len)));
}