Step::Tracker.check_track_restrictions! checks that track added on a new tile is part of the laying corporation's network, unless TRACK_RESTRICTION is :permissive. However, the way this function is structured means that we always check the game graph for connection to new track, even for :permissive games. As a new tile is being laid accessing graph.connected_paths will end up calling graph.compute.
This computation could be avoided by adding a return if @game.class::TRACK_RESTRICTION == :permissive guard at the start of the function.
This is something I noticed whilst looking at graph code, recording it here so it's not forgotten…
Step::Tracker.check_track_restrictions!checks that track added on a new tile is part of the laying corporation's network, unlessTRACK_RESTRICTIONis:permissive. However, the way this function is structured means that we always check the game graph for connection to new track, even for:permissivegames. As a new tile is being laid accessinggraph.connected_pathswill end up callinggraph.compute.This computation could be avoided by adding a
return if @game.class::TRACK_RESTRICTION == :permissiveguard at the start of the function.This is something I noticed whilst looking at graph code, recording it here so it's not forgotten…