MCPcopy Create free account
hub / github.com/WinMerge/winmerge / GetDistance

Function GetDistance

Src/MergeDocDiffCopy.cpp:800–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798}
799
800static int GetDistance(const CDiffTextBuffer& buf, const CEPoint& pt1, const CEPoint& pt2)
801{
802 assert(pt1.y < pt2.y || (pt1.y == pt2.y && pt1.x <= pt2.x));
803 int distance = 0;
804 for (int y = pt1.y; y <= pt2.y; ++y)
805 {
806 distance += buf.GetFullLineLength(y);
807 if (y == pt1.y)
808 distance -= pt1.x;
809 if (y == pt2.y)
810 distance -= buf.GetFullLineLength(y) - pt2.x;
811 }
812 return distance;
813};
814
815static CEPoint Advance(const CDiffTextBuffer& buf, const CEPoint& pt, int distance)
816{

Callers 1

GetCharacterRangeMethod · 0.85

Calls 1

assertClass · 0.85

Tested by

no test coverage detected