MCPcopy Create free account
hub / github.com/SmingHub/Sming / equals

Method equals

Sming/Wiring/WString.cpp:553–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551}
552
553bool String::equals(const char* cstr) const
554{
555 auto len = length();
556 if(len == 0) {
557 return (cstr == nullptr || *cstr == '\0');
558 }
559 if(cstr == nullptr) {
560 return false;
561 }
562 auto cstrlen = strlen(cstr);
563 if(len != cstrlen) {
564 return false;
565 }
566 return memcmp(cbuffer(), cstr, len) == 0;
567}
568
569bool String::equals(const char* cstr, size_t length) const
570{

Callers 6

executeMethod · 0.45
executeMethod · 0.45
executeMethod · 0.45
executeMethod · 0.45
findMethod · 0.45
operator==Method · 0.45

Calls 1

lengthMethod · 0.95

Tested by 1

executeMethod · 0.36