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

Function polishedSelections

src/plugins/git/utils/diffutils.cpp:63–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63DiffSelections polishedSelections(const DiffSelections &selections)
64{
65 DiffSelections polishedSelections;
66 for (auto it = selections.cbegin(), end = selections.cend(); it != end; ++it) {
67 const QList<DiffSelection> diffSelections = it.value();
68 QList<DiffSelection> workingList;
69 for (const DiffSelection &diffSelection : diffSelections) {
70 if (diffSelection.start == -1 && diffSelection.end == 0)
71 continue;
72
73 if (diffSelection.start == diffSelection.end && diffSelection.start >= 0)
74 continue;
75
76 int j = 0;
77 while (j < workingList.count()) {
78 const DiffSelection existingSelection = workingList.takeAt(j);
79 const QList<DiffSelection> newSelection = subtractSelection(existingSelection, diffSelection);
80 for (int k = 0; k < newSelection.count(); k++)
81 workingList.insert(j + k, newSelection.at(k));
82 j += newSelection.count();
83 }
84 workingList.append(diffSelection);
85 }
86 polishedSelections.insert(it.key(), workingList);
87 }
88 return polishedSelections;
89}
90
91int DiffChunkInfo::chunkIndexForBlockNumber(int blockNumber) const
92{

Callers 1

diffOutputMethod · 0.85

Calls 9

subtractSelectionFunction · 0.85
cbeginMethod · 0.80
cendMethod · 0.80
insertMethod · 0.80
atMethod · 0.80
valueMethod · 0.45
countMethod · 0.45
appendMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected