-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Perf] Improve efficiency of vehicle code.
* Add a new function, has_parts() which takes a list of flags and checks if the vehicle has parts which have them. Equivalent to calling has_part multiple times, but more performant. * Replace get_all_parts() with boarded_parts() in vehicle::get_driver(). Each part would check all the parts that its mounted to to see whether they had a passenger, requiring a lot of redundant checks.
- Loading branch information
Showing
3 changed files
with
51 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters