MCPcopy Create free account
hub / github.com/KDE/kdevelop / compare

Method compare

kdevplatform/util/path.cpp:268–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268int Path::compare(const Path& other, Qt::CaseSensitivity cs) const
269{
270 const int size = m_data.size();
271 const int otherSize = other.m_data.size();
272 const int toCompare = std::min(size, otherSize);
273
274 // compare each Path segment in turn and try to return early
275 for (int i = 0; i < toCompare; ++i) {
276 const int comparison = m_data.at(i).compare(other.m_data.at(i), cs);
277 if (comparison != 0) {
278 return comparison;
279 }
280 }
281
282 // when we reach this point, all elements that we compared where equal
283 // thus return the segment count difference between the two paths
284 return size - otherSize;
285}
286
287QUrl Path::toUrl() const
288{

Callers 9

lessThanMethod · 0.45
languagesForFileNameMethod · 0.45
createCustomElementMethod · 0.45
findActionInsertionPointFunction · 0.45
lessThanMethod · 0.45
shouldRenameFileMethod · 0.45
testPathComparisonMethod · 0.45
matchMethod · 0.45

Calls 2

sizeMethod · 0.45
atMethod · 0.45

Tested by 1

testPathComparisonMethod · 0.36