Don't create a temporary string when comparing a const char* key
This commit is contained in:
parent
b5a01851d9
commit
ae96d2fbca
@ -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) {
|
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
|
// indexing
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user