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

Switches optimisations improvements and fixes #170

Merged
merged 3 commits into from Nov 16, 2020

Conversation

glx22
Copy link
Contributor

@glx22 glx22 commented Nov 14, 2020

Before this rewrite, an optimised switch could output a returns a constant, optimising warning at each usage location, and a bogus is not referenced, ignoring warning. Now only one returns a constant, optimising happens.

There was also an bug in is_read_only.

@glx22 glx22 force-pushed the optimisations branch 2 times, most recently from 7427686 to 402a19b Compare November 14, 2020 23:33
@glx22 glx22 changed the title Codechange: reduce warnings from switches optimisations Switches optimisations improvements and fixes Nov 15, 2020
@glx22 glx22 force-pushed the optimisations branch 2 times, most recently from 8cb902f to 7794dae Compare November 15, 2020 21:05
Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine to me. Would be nice to have some extra tests, I suppose

@glx22 glx22 merged commit 2d27a08 into OpenTTD:master Nov 16, 2020
@glx22 glx22 deleted the optimisations branch November 16, 2020 13:09
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.

None yet

2 participants