MCPcopy Create free account
hub / github.com/KDE/kate / addNumStat

Function addNumStat

addons/project/git/gitstatus.cpp:186–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186static void addNumStat(QList<GitUtils::StatusItem> &items, int add, int sub, std::string_view file)
187{
188 // look in modified first, then staged
189 auto item = std::find_if(items.begin(), items.end(), [file](const GitUtils::StatusItem &si) {
190 return file.compare(0, si.file.size(), si.file.data()) == 0;
191 });
192 if (item != items.end()) {
193 item->linesAdded = add;
194 item->linesRemoved = sub;
195 return;
196 }
197}
198
199static std::optional<int> toInt(std::string_view s)
200{

Callers 1

parseDiffNumStatMethod · 0.85

Calls 4

sizeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected