diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-18 19:12:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-18 19:12:47 +0300 |
commit | fe504040c415c8d2692dcbd1c6374ae52ee52777 (patch) | |
tree | 4cac2e57a86c61af6711af303124611cc2e8d2f8 | |
parent | 43159aed2516e648c9d050b3312aa7678d2fae05 (diff) | |
download | manaplus-fe504040c415c8d2692dcbd1c6374ae52ee52777.tar.gz manaplus-fe504040c415c8d2692dcbd1c6374ae52ee52777.tar.bz2 manaplus-fe504040c415c8d2692dcbd1c6374ae52ee52777.tar.xz manaplus-fe504040c415c8d2692dcbd1c6374ae52ee52777.zip |
Remove extra checks.
-rw-r--r-- | src/input/inputactionsortfunctor.h | 10 | ||||
-rw-r--r-- | src/input/inputmanager.cpp | 30 |
2 files changed, 1 insertions, 39 deletions
diff --git a/src/input/inputactionsortfunctor.h b/src/input/inputactionsortfunctor.h index 3de625fea..ec556bf39 100644 --- a/src/input/inputactionsortfunctor.h +++ b/src/input/inputactionsortfunctor.h @@ -35,16 +35,6 @@ class InputActionSortFunctor final { const size_t k1 = CAST_SIZE(key1); const size_t k2 = CAST_SIZE(key2); - if (k1 >= CAST_SIZE(InputAction::TOTAL)) - { - logger->log("broken key1: %ld", static_cast<long>(k1)); - return false; - } - if (k2 >= CAST_SIZE(InputAction::TOTAL)) - { - logger->log("broken key2: %ld", static_cast<long>(k2)); - return false; - } return keys[k1].priority > keys[k2].priority; } diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index a49f7ab49..1f9869d4d 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -894,10 +894,6 @@ void InputManager::updateKeyActionMap(KeyToActionMap &restrict actionMap, { actionMap[ki.value].push_back( static_cast<InputActionT>(i)); - logger->log("add key: %d, action: %d, size: %ld", - ki.value, - CAST_S32(i), - static_cast<long>(actionMap[ki.value].size())); } } } @@ -927,32 +923,8 @@ void InputManager::updateKeyActionMap(KeyToActionMap &restrict actionMap, KeysVector *const keys = &it->second; if (!keys) continue; - const size_t sz = keys->size(); - if (sz > 1) - { - logger->log("actions size: key: %d, size: %d", - it->first, - CAST_S32(sz)); - int sum = 0; - FOR_EACHP (KeysVectorIter, itk, keys) - { - const size_t val = CAST_SIZE(*itk); - if (val >= CAST_SIZE(InputAction::TOTAL)) - { - logger->log("wrong action index: %ld", - static_cast<long>(val)); - break; - } - else - { - logger->log("action index: %ld", - static_cast<long>(val)); - } - sum += inputActionData[val].priority; - } - logger->log("sum: %d", sum); + if (keys->size() > 1) std::sort(keys->begin(), keys->end(), inputActionDataSorter); - } } } |