Skip to content

Fixes Cost.__add__ returning references#244

Merged
BurnySc2 merged 1 commit intoBurnySc2:developfrom
maxnus:fix-cost-add
Apr 25, 2026
Merged

Fixes Cost.__add__ returning references#244
BurnySc2 merged 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__.

@BurnySc2 BurnySc2 merged commit 81d6611 into BurnySc2:develop Apr 25, 2026
42 of 43 checks passed
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.

2 participants