-- Return the number of common items that follow in forward direction.
-- The length of what Myers paper calls a “snake” in a forward path.

local function countCommonItemsF(aIndex: number, aEnd: number, bIndex: number, bEnd: number, isCommon: IsCommon): number
	local nCommon = 0
	while aIndex < aEnd and bIndex < bEnd and isCommon(aIndex, bIndex) do
		aIndex += 1
		bIndex += 1
		nCommon += 1
	end
	return nCommon
end
