[Commits] [wesnoth/wesnoth] 2cc3f9: Hotkeys: cleanup and simplification of hotkey_comm...

GitHub noreply at github.com
Wed Nov 22 01:06:47 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 2cc3f99651c9de13eb36ab0c490996a8dd47e50e
      https://github.com/wesnoth/wesnoth/commit/2cc3f99651c9de13eb36ab0c490996a8dd47e50e
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2017-11-22 (Wed, 22 Nov 2017)

  Changed paths:
    M src/gui/widgets/grid.hpp
    M src/hotkey/hotkey_command.cpp
    M src/hotkey/hotkey_command.hpp

  Log Message:
  -----------
  Hotkeys: cleanup and simplification of hotkey_command list

* Used an std::array instead of C array for hotkey_list_.
* Used an std::vector instead of boost::ptr_array for known_hotkeys.
* Made hotkey_command non-copyable and movable in order to avoid hundreds of copies.
* Added a hotkey_command ctor that takes a hotkey_command_temp reference.
* Hopefully prevent some reallocations by reserving an appropriate amount of memory for known_hotkeys
  before filling it up.
* Search from the end of know_hotkeys when calling remove_wml_hotkey(). This avoids traversing the almost
  200 vector members that likely will not match.
* Deployed auto/range-for.
* For some reason I needed to add a <cassert> include to gui2/widgets/grid.hpp.





More information about the Commits mailing list