Skip to content

Commit

Permalink
Declared const to quieten cppcheck eronous warning
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed May 18, 2023
1 parent 5688f3b commit 84d9385
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vsg/ui/Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ bool Keyboard::pressed(KeySymbol key, bool ignore_handled_keys) const
auto itr = keyState.find(key);
if (itr == keyState.end()) return false;

auto& keyHistory = itr->second;
const auto& keyHistory = itr->second;
if (keyHistory.timeOfKeyRelease != keyHistory.timeOfFirstKeyPress)
{
return false;
Expand All @@ -97,7 +97,7 @@ std::pair<double, double> Keyboard::times(KeySymbol key, bool ignore_handled_key

auto currentTime = clock::now();

auto& keyHistory = itr->second;
const auto& keyHistory = itr->second;
if (keyHistory.timeOfKeyRelease != keyHistory.timeOfFirstKeyPress)
{
return {std::chrono::duration<double, std::chrono::seconds::period>(currentTime - keyHistory.timeOfFirstKeyPress).count(),
Expand Down

0 comments on commit 84d9385

Please sign in to comment.