Optimization of pathfinding when clearing fog/shroud.

(bitwise operation don't do short-circuit evaluation, and the useless
call was the most expensive operation of this loop)

We can add this to the list:"Performance are often killed by
compilable 1-character typo" (in fact, I commit this change separately
just for that ;p ).
This commit is contained in:
Ali El Gariani 2007-12-08 02:36:13 +00:00
parent 5fd5c96505
commit 90451b8e2c

View file

@ -173,7 +173,7 @@ static void find_routes(const gamemap& map, const gamestatus& status,
--new_turns_left;
new_move_left = u.total_movement() - move_cost;
}
const bool skirmisher = force_ignore_zocs | u.get_ability_bool("skirmisher",currentloc);
const bool skirmisher = force_ignore_zocs || u.get_ability_bool("skirmisher",currentloc);
const bool zoc = !skirmisher && enemy_zoc(map,units,teams,currentloc, viewing_team,u.side(),see_all);
const int zoc_move_left = zoc ? 0 : new_move_left;