Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move calculation of data out of its enumeration in NoSmallGapsStrategy #12

Open
mmmcaffeine opened this issue Nov 18, 2021 · 0 comments
Labels
refactor The implementation is not right

Comments

@mmmcaffeine
Copy link
Owner

We have a couple of methods in NoSmallGapsStrategy of FindAllIndices and FindGaps. 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 in Execute we're calculating more things about the gap! Specifically this is the index of the last cell. We should keep Execute to only doing the enumeration, and move all calculations about the gap into the FindGaps 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 access Range.Start and Range.End in other places, which isn't quite as neat 🤷‍♂️

@mmmcaffeine mmmcaffeine added the refactor The implementation is not right label Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor The implementation is not right
Projects
None yet
Development

No branches or pull requests

1 participant