-
Notifications
You must be signed in to change notification settings - Fork 0
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
Larry said there's a way to speed this up #1
Comments
we don't need to fill the array up more than the result of GSRandRange. should cut memory usage (and probably run time) in half in the average case. |
Iterating over the GSList entries has a deterministic order, right? |
Yes, provided there is no other operation going on to GSList. There may be a race condition if elsewhere in the program GSList is being resorted. |
Mmm, good to know. I imagine that would matter more for scripts that run during gameplay than for the industry constructor. |
It should be stated that the current implementation is also potentially faulty to a race condition |
While I have not sped this up I realized this was itself a way better implementation of random access than what I had in the industry placer. |
ottd-util/random.nut
Line 6 in 97824ae
I will never let you forget anything
The text was updated successfully, but these errors were encountered: