MCPcopy Create free account
hub / github.com/KDE/kdiff3 / optimize

Method optimize

src/diff.cpp:1412–1434  ·  view source on GitHub ↗

Compute fineDiff

Source from the content-addressed store, hash-verified

1410}
1411//Compute fineDiff
1412void DiffList::optimize()
1413{
1414 DiffList::iterator dli;
1415 bool bUsefulFineDiff = false;
1416 qint64 index = 0;
1417
1418 for(const Diff& diff: *this)
1419 {
1420 if(diff.numberOfEquals() >= 4)
1421 {
1422 bUsefulFineDiff = true;
1423 break;
1424 }
1425 }
1426
1427 for(Diff& diff: *this)
1428 {
1429 if(!bUsefulFineDiff || index <= 0)
1430 diff.refine();
1431
1432 ++index;
1433 }
1434}
1435
1436bool Diff3Line::fineDiff(bool inBTextsTotalEqual, const e_SrcSelector selector, const std::shared_ptr<LineDataVector> &v1, const std::shared_ptr<LineDataVector> &v2, const IgnoreFlags eIgnoreFlags)
1437{

Callers 2

fineDiffMethod · 0.80
availableCodecsMethod · 0.80

Calls 2

numberOfEqualsMethod · 0.80
refineMethod · 0.80

Tested by

no test coverage detected