Open artoonie opened 3 months ago
testing some slice level tally stuff and thinking about this. What if RoundTally was made aware of tabulation level slices when it was initialized and all the current methods that update tallies would fill in slice tallies based on what was initialized. I don't have all the context for coupling and what is unhealthy code practices but if RoundTally knew about the slices it could be made responsible for filling them in.
I think we're on the same page here with bullet point (1) -- RoundTally could know about slices and force the caller to provide slice-level data where it's required.
Message ID: @.***>
The "Tabulate by Slice" code works by keeping entirely separate structures throughout the tabulation process for by-slice versus whole-contest results.
This separation requires every call to a whole-contest structure to be followed by a call to the per-slice structure.
That manual process is error-prone, hard to test, and makes the code a little sloppy.
I recommend we refactor this. The specifics TBD, but some ideas:
RoundTally.addX(RoundTallies, x
)addX(RoundTally wholeContest, RoundTallies bySlices)
I lean towards (3).