diff --git a/mutalyzer/util.py b/mutalyzer/util.py index e340ebe5a8d3f113d6c07ac5b04d2a4c8b34983f..237413fbecd1a28ca50e87ea5ad3a213e9d5d154 100644 --- a/mutalyzer/util.py +++ b/mutalyzer/util.py @@ -218,6 +218,24 @@ def format_range(first, last): return '%i_%i' % (first, last) #format_range +def roll_(s, start, end) : + """ + Different (and easier) way of finding the variability of a substring. + """ + # TODO: Start counting at 1, testing, etc. + + l = len(s) + + i = 0 + while end + i + 1 < l and s[start + i] == s[end + i + 1] : + i += 1 + + j = 0 + while start - j and s[start - j - 1] == s[end - j] : + j += 1 + + return j, i +#roll def roll(s, first, last): """