Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
102 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ | |
|
||
#include "gui/widgets/widget.hpp" | ||
|
||
#include <cassert> | ||
|
||
namespace gui2 | ||
{ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters