Move calculation of data out of its enumeration in NoSmallGapsStrategy
#12
Labels
refactor
The implementation is not right
NoSmallGapsStrategy
#12
We have a couple of methods in
NoSmallGapsStrategy
ofFindAllIndices
andFindGaps
. The latter is returning a tuple with information about the gap i.e. the index of the first cell, and the length. However, when we enumerate the return value of this method inExecute
we're calculating more things about the gap! Specifically this is the index of the last cell. We should keepExecute
to only doing the enumeration, and move all calculations about the gap into theFindGaps
method.We could achieve this by changing the return tuple to either
(int StartIndex, int EndIndex, int Length)
or(Range Range, int Length)
The latter would be nice as we could pass it directly to the array indexer when checking all the cells in the gap are undetermined. That would also mean we'd have to accessRange.Start
andRange.End
in other places, which isn't quite as neat 🤷♂️The text was updated successfully, but these errors were encountered: