Don't create a temporary string when comparing a const char* key

This commit is contained in:
k0zmo 2020-07-18 21:20:33 +02:00
parent b5a01851d9
commit ae96d2fbca

View File

@ -106,7 +106,11 @@ inline bool node::equals(const T& rhs, shared_memory_holder pMemory) {
}
inline bool node::equals(const char* rhs, shared_memory_holder pMemory) {
return equals<std::string>(rhs, pMemory);
std::string lhs;
if (convert<std::string>::decode(Node(*this, std::move(pMemory)), lhs)) {
return lhs == rhs;
}
return false;
}
// indexing