[Commits] [wesnoth/wesnoth] a13157: Messenger Micro AI: minor code simplification

GitHub noreply at github.com
Thu Apr 10 14:36:51 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: a131572e09d1c31cf2f6257dbb8deb76dd0fc185
      https://github.com/wesnoth/wesnoth/commit/a131572e09d1c31cf2f6257dbb8deb76dd0fc185
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2014-04-10 (Thu, 10 Apr 2014)

  Changed paths:
    M data/ai/micro_ais/cas/ca_messenger_escort_move.lua

  Log Message:
  -----------
  Messenger Micro AI: minor code simplification


  Commit: 161470c1490cda23a511941a75a5be73306f8158
      https://github.com/wesnoth/wesnoth/commit/161470c1490cda23a511941a75a5be73306f8158
  Author: mattsc <mattsc000 at gmail.com>
  Date:   2014-04-10 (Thu, 10 Apr 2014)

  Changed paths:
    M data/ai/micro_ais/cas/ca_forest_animals_move.lua
    M data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua
    M data/ai/micro_ais/cas/ca_goto.lua
    M data/ai/micro_ais/cas/ca_messenger_attack.lua
    M data/ai/micro_ais/cas/ca_simple_attack.lua
    M data/ai/micro_ais/cas/ca_swarm_move.lua
    M data/ai/micro_ais/cas/ca_wolves_multipacks_attack.lua
    M data/ai/micro_ais/cas/ca_wolves_multipacks_functions.lua

  Log Message:
  -----------
  Micro AIs: avoid using table.remove

It’s slow.  The inverse logic using table.insert is much faster,
especially for large tables.  Only kept table.remove in a couple places
where it doesn’t matter.


Compare: https://github.com/wesnoth/wesnoth/compare/f1b0e66629ae...161470c1490c


More information about the Commits mailing list