MCPcopy Create free account
hub / github.com/HelenOS/helenos / compare

Method compare

uspace/lib/cpp/include/__bits/string/string.hpp:1436–1449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1434 }
1435
1436 int compare(const basic_string& other) const noexcept
1437 {
1438 auto len = min(size(), other.size());
1439 auto comp = traits_type::compare(data_, other.data(), len);
1440
1441 if (comp != 0)
1442 return comp;
1443 else if (size() == other.size())
1444 return 0;
1445 else if (size() > other.size())
1446 return 1;
1447 else
1448 return -1;
1449 }
1450
1451 int compare(size_type pos, size_type n, const basic_string& other) const
1452 {

Callers 7

test_compareMethod · 0.45
operator==Function · 0.45
operator!=Function · 0.45
operator<Function · 0.45
operator>Function · 0.45
operator<=Function · 0.45
operator>=Function · 0.45

Calls 3

basic_stringClass · 0.70
sizeMethod · 0.45
dataMethod · 0.45

Tested by 1

test_compareMethod · 0.36