[Commits] [wesnoth/wesnoth] 4685ae: Fix #2339: iterating wesnoth.unit_types is extreme...

GitHub noreply at github.com
Wed Jan 31 17:50:30 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 4685aed6a58fb234cc9de6304016c76539bc07d8
      https://github.com/wesnoth/wesnoth/commit/4685aed6a58fb234cc9de6304016c76539bc07d8
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2018-01-31 (Wed, 31 Jan 2018)

  Changed paths:
    M src/scripting/lua_unit_type.cpp

  Log Message:
  -----------
  Fix #2339: iterating wesnoth.unit_types is extremely slow

The problem was that the code copied the entire list of unit types every
time Lua moved to the next unit type. Fixed by taking a reference to it
instead.

Thanks to @ilyapopov for identifying the problem.





More information about the Commits mailing list