Skip to content

Fixes Cost.__add__ returning references#244

Open
maxnus wants to merge 1 commit intoBurnySc2:developfrom
maxnus:fix-cost-add
Open

Fixes Cost.__add__ returning references#244
maxnus wants to merge 1 commit intoBurnySc2:developfrom
maxnus:fix-cost-add

Conversation

@maxnus
Copy link
Copy Markdown
Contributor

@maxnus maxnus commented Apr 24, 2026

This caused a bug for me that took very long to find:

In Cost.__add__ we return the other cost object if the first one is (0, 0) - by reference! This should at least return a copy, but really we don't need this micro optimization here, so I removed the clauses.

I also fixed the time sign in __sub__.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant