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

Order of checks in commands need verification #5222

Closed
DorpsGek opened this issue Jun 26, 2012 · 2 comments
Closed

Order of checks in commands need verification #5222

DorpsGek opened this issue Jun 26, 2012 · 2 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

Kogut opened the ticket and wrote:

if somebody attempts adding rail that is impossible due to terrain, on tile occupied by train reported error will be "train in the way" instead of "land sloped in wrong direction"

from http://www.tt-forums.net/viewtopic.php?f=32&t=61426

Reported version: Version?
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5222
@DorpsGek
Copy link
Member Author

DorpsGek commented Jul 7, 2012

Alberth wrote:

In general, checks are ordered to make failure as cheap as possible. Easy and fast checks are performed first so failure does not waste a lot of CPU time.

I verified this instance, and it seems to make sense in this case to swap the checks (patch attached).
That in turn means our code is not optimal in this respect. All commands should be verified for the order of checks.
Can you please find out which checks are in the wrong order? (In terms of increasing CPU costs.)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5222#comment11324

@DorpsGek
Copy link
Member Author

andythenorth closed the ticket.

Reason for closing: Won't implement

Mass closure of patch tickets with no commentary for >5 years. Goal is to reduce patch queue as an experiment to see if it aids faster reviewing and rejection/acceptance (it may not). If this offends you and the patch is maintained and compiles with current trunk, discuss with andythenorth in irc. (andythenorth has no ability to review patches but can re-open tickets).


This comment was imported from FlySpray: https://bugs.openttd.org/task/5222

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant