Skip to content

Commit

Permalink
Make hotkeys copyable again
Browse files Browse the repository at this point in the history
There is barely any point in moving hotkeys because the command is the only
member variable that's both 1) movable and 2) faster to move than copy. In
2cc3f99, @Vultraz talked about "avoiding hundreds of copies", but
moving isn't necessarily any faster than copying. Seriously, making hotkeys
noncopyable was just a premature and obviously unprofiled optimization.

Besides, this also fixes build on Visual Studio 2013.
  • Loading branch information
jyrkive committed Nov 22, 2017
1 parent a4a1cec commit 722f319
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/hotkey/hotkey_command.hpp
Expand Up @@ -238,12 +238,7 @@ struct hotkey_command

hotkey_command(HOTKEY_COMMAND cmd, const std::string& id, const t_string& desc, bool hidden, bool toggle, hk_scopes scope, HOTKEY_CATEGORY category, const t_string& tooltip);

/** Needed for vector::erase. */
hotkey_command(hotkey_command&&) = default;
hotkey_command& operator=(hotkey_command&&) = default;

/** This shouldn't be copyable. */
hotkey_command(const hotkey_command&) = delete;
hotkey_command(const hotkey_command&) = default;
hotkey_command& operator=(const hotkey_command&) = default;

/// the names are strange: the "hotkey::HOTKEY_COMMAND" is named id, and the string to identify the object is called "command"
Expand Down

0 comments on commit 722f319

Please sign in to comment.