Browse Source

address performance-unnecessary-value-param

clang-tidy warns about the unnecessary copy for these params

Could also potentially use std::make_unique if the Action constructor wasn't declared private?
pull/3921/head
Andrew James 4 years ago committed by Anders Jenbo
parent
commit
8fa04ce651
  1. 2
      Source/options.cpp

2
Source/options.cpp

@ -1166,7 +1166,7 @@ bool KeymapperOptions::Action::SetValue(int value)
void KeymapperOptions::AddAction(string_view key, string_view name, string_view description, int defaultKey, std::function<void()> action, std::function<bool()> enable, int index)
{
actions.push_back(std::unique_ptr<Action>(new Action(key, name, description, defaultKey, action, enable, index)));
actions.push_back(std::unique_ptr<Action>(new Action(key, name, description, defaultKey, std::move(action), std::move(enable), index)));
}
void KeymapperOptions::KeyPressed(int key) const

Loading…
Cancel
Save