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

Bugfix for Tms#add! not updating @total #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

droleary
Copy link

Because the total instance variable only updates in initialize, it does not reflect the correct value when add! is called. This fixes the problem.

A test case is provided to show the bug/fix.

A more robust solution would be to use a total method instead to return the calculated value. It may be worth checking if such a solution is generally faster than doing the calculation every time a Tms object is created/updated. Benchmark the benchmarking! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant