Removed StringAdapter::equals()

This commit is contained in:
Benoit Blanchon
2021-07-27 13:52:13 +02:00
parent 5790f3c8f7
commit 6632fa8da1
11 changed files with 2 additions and 65 deletions

View File

@ -107,7 +107,7 @@ template <typename TAdaptedString>
inline VariantSlot* CollectionData::getSlot(TAdaptedString key) const {
VariantSlot* slot = _head;
while (slot) {
if (key.equals(slot->key()))
if (key.compare(slot->key()) == 0)
break;
slot = slot->next();
}

View File

@ -167,7 +167,7 @@ class MemoryPool {
template <typename TAdaptedString>
const char* findString(const TAdaptedString& str) {
for (char* next = _begin; next < _left; ++next) {
if (str.equals(next))
if (str.compare(next) == 0)
return next;
// jump to next terminator

View File

@ -32,10 +32,6 @@ class StringAdapter< ::String> {
return safe_strcmp(me, other);
}
bool equals(const char* expected) const {
return compare(expected) == 0;
}
size_t size() const {
return _str->length();
}

View File

@ -22,10 +22,6 @@ class StringAdapter<const char*> {
return safe_strcmp(_str, other);
}
bool equals(const char* expected) const {
return compare(expected) == 0;
}
bool isNull() const {
return !_str;
}

View File

@ -25,10 +25,6 @@ class StringAdapter<const __FlashStringHelper*> {
return -strcmp_P(other, reinterpret_cast<const char*>(_str));
}
bool equals(const char* expected) const {
return compare(expected) == 0;
}
bool isNull() const {
return !_str;
}

View File

@ -26,10 +26,6 @@ class StringAdapter<const __FlashStringHelper*, true> {
return -strncmp_P(other, reinterpret_cast<const char*>(_str), _size);
}
bool equals(const char* expected) const {
return compare(expected) == 0;
}
bool isNull() const {
return !_str;
}

View File

@ -21,10 +21,6 @@ class StringAdapter<TChar*, true> {
return safe_strncmp(_str, other, _size);
}
bool equals(const char* expected) const {
return compare(expected) == 0;
}
bool isNull() const {
return !_str;
}

View File

@ -33,12 +33,6 @@ class StringAdapter<std::basic_string<char, TCharTraits, TAllocator> > {
return _str->compare(other);
}
bool equals(const char* expected) const {
if (!expected)
return false;
return *_str == expected;
}
size_t size() const {
return _str->size();
}

View File

@ -31,12 +31,6 @@ class StringAdapter<std::string_view> {
return _str.compare(other);
}
bool equals(const char* expected) const {
if (!expected)
return false;
return _str == expected;
}
size_t size() const {
return _str.size();
}