[Commits] [wesnoth/wesnoth] a6dece: refactor unit filters

GitHub noreply at github.com
Sun Aug 27 20:05:46 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: a6decea0fcfd3b0af3520d2637cf085da7277eb5
      https://github.com/wesnoth/wesnoth/commit/a6decea0fcfd3b0af3520d2637cf085da7277eb5
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2017-08-27 (Sun, 27 Aug 2017)

  Changed paths:
    M src/units/filter.cpp
    M src/units/filter.hpp

  Log Message:
  -----------
  refactor unit filters

This refactors the unit filter so that it now parses as much as possible when
the filter is created to speed up the filter::matches function. This also make
the provious optimisation of having a special empty filter unnecessary.


  Commit: c6e5c57a85d727a3063b08e67c4a9a735680b523
      https://github.com/wesnoth/wesnoth/commit/c6e5c57a85d727a3063b08e67c4a9a735680b523
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2017-08-27 (Sun, 27 Aug 2017)

  Changed paths:
    M src/side_filter.cpp
    M src/terrain/filter.cpp
    M src/units/abilities.cpp
    M src/units/filter.hpp

  Log Message:
  -----------
  remove set_flat_tod from unit_filter ctor parmaters


  Commit: dac782925af42226b71cc1d8c37f542fb6b492c0
      https://github.com/wesnoth/wesnoth/commit/dac782925af42226b71cc1d8c37f542fb6b492c0
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2017-08-27 (Sun, 27 Aug 2017)

  Changed paths:
    M src/ai/lua/lua_object.cpp
    M src/scripting/lua_common.cpp
    M src/variable.cpp
    M src/variable.hpp

  Log Message:
  -----------
  vconfig optimisation


  Commit: 31bb0ecde3cb744059ba06f4922754ec99cdf419
      https://github.com/wesnoth/wesnoth/commit/31bb0ecde3cb744059ba06f4922754ec99cdf419
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2017-08-27 (Sun, 27 Aug 2017)

  Changed paths:
    M src/side_filter.cpp
    M src/terrain/filter.cpp
    M src/units/filter.hpp

  Log Message:
  -----------
  don't always copy the underlying config on side filters

I checked all codes that construct side filters but i couldn't find a
single occurance where the side filter object lived longer than the
underlying config object. (there were occurances in
terrain_filter/side_filer where i was not sure so i added an extra
make_safe there). Feels a littlte strange since there should've been a
reason why that make_safe call was added in the first place.


  Commit: d2de54d84c8aa312ebc5eafc2a0fccb531e088b3
      https://github.com/wesnoth/wesnoth/commit/d2de54d84c8aa312ebc5eafc2a0fccb531e088b3
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2017-08-27 (Sun, 27 Aug 2017)

  Changed paths:
    M src/units/filter.cpp

  Log Message:
  -----------
  rename variablename u to args in unit filters

by (notepad++) regex replace
`u\.(use_flat_tod|u2|fc|u|loc)([^a-zA-Z1-9])` to `args\.\1\2`


  Commit: 4dcbf6e69bc2db75e84c9bb00c20581452d1de85
      https://github.com/wesnoth/wesnoth/commit/4dcbf6e69bc2db75e84c9bb00c20581452d1de85
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2017-08-27 (Sun, 27 Aug 2017)

  Changed paths:
    M src/ai/lua/lua_object.cpp
    M src/scripting/lua_common.cpp
    M src/side_filter.cpp
    M src/terrain/filter.cpp
    M src/units/abilities.cpp
    M src/units/filter.cpp
    M src/units/filter.hpp
    M src/variable.cpp
    M src/variable.hpp

  Log Message:
  -----------
  Merge pull request #1906 from gfgtdf/filter_refactor

This refactors the unit filter so that it now parses as much as possible when
the filter is created to speed up the filter::matches function. This also makes
the provious optimisation of having a special empty filter unnecessary.


Compare: https://github.com/wesnoth/wesnoth/compare/1b7bc55f194f...4dcbf6e69bc2


More information about the Commits mailing list