diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-25 02:26:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-25 02:26:34 +0300 |
commit | c9f43996f3147100627ee2c6f9da993ceb160113 (patch) | |
tree | 7577f02f4658b19e05d586f66b67a9a4f5fedb7e /src/inputmanager.cpp | |
parent | 8e19f9b9d792cf4d3d3b022fd26a258c3d3d97bf (diff) | |
download | ManaVerse-c9f43996f3147100627ee2c6f9da993ceb160113.tar.gz ManaVerse-c9f43996f3147100627ee2c6f9da993ceb160113.tar.bz2 ManaVerse-c9f43996f3147100627ee2c6f9da993ceb160113.tar.xz ManaVerse-c9f43996f3147100627ee2c6f9da993ceb160113.zip |
Improve iterators part 2.
Diffstat (limited to 'src/inputmanager.cpp')
-rw-r--r-- | src/inputmanager.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/inputmanager.cpp b/src/inputmanager.cpp index 60e4a7bca..3a4ee1b9b 100644 --- a/src/inputmanager.cpp +++ b/src/inputmanager.cpp @@ -106,10 +106,9 @@ void InputManager::retrieve() StringVect keys; splitToStringVector(keys, keyStr, ','); - StringVectCIter it = keys.begin(); - StringVectCIter it_end = keys.end(); int i2 = 0; - for (; it != it_end && i2 < KeyFunctionSize; ++ it) + for (StringVectCIter it = keys.begin(), it_end = keys.end(); + it != it_end && i2 < KeyFunctionSize; ++ it) { std::string keyStr2 = *it; if (keyStr.size() < 2) @@ -619,9 +618,8 @@ void InputManager::updateKeyActionMap(KeyToActionMap &actionMap, } keySorter.keys = &keyData[0]; - KeyToActionMapIter it = actionMap.begin(); - KeyToActionMapIter it_end = actionMap.end(); - for (; it != it_end; ++ it) + for (KeyToActionMapIter it = actionMap.begin(), it_end = actionMap.end(); + it != it_end; ++ it) { KeysVector *keys = &it->second; if (keys && keys->size() > 1) @@ -635,10 +633,9 @@ bool InputManager::triggerAction(const KeysVector *ptrs) return false; // logger->log("ptrs: %d", (int)ptrs.size()); - KeysVectorCIter it = ptrs->begin(); - KeysVectorCIter it_end = ptrs->end(); - for (; it != it_end; ++ it) + for (KeysVectorCIter it = ptrs->begin(), it_end = ptrs->end(); + it != it_end; ++ it) { const int keyNum = *it; if (keyNum < 0 || keyNum >= Input::KEY_TOTAL) |