MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / commonSuffix

Function commonSuffix

src/plugins/git/utils/differ.cpp:26–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26static int commonSuffix(const QString &text1, const QString &text2)
27{
28 int i = 0;
29 const int text1Count = text1.size();
30 const int text2Count = text2.size();
31 const int maxCount = qMin(text1Count, text2Count);
32 while (i < maxCount) {
33 if (text1.at(text1Count - i - 1) != text2.at(text2Count - i - 1))
34 break;
35 i++;
36 }
37 return i;
38}
39
40static int commonOverlap(const QString &text1, const QString &text2)
41{

Callers 3

preprocess1AndDiffMethod · 0.85
mergeMethod · 0.85

Calls 2

atMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected