summaryrefslogtreecommitdiff
path: root/plugins/Variables/src/parse_alias.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-21 18:40:03 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-02-21 18:40:14 +0300
commit477a6ea70d0bb1b1dfe9cbd9a15b6dad0284ddeb (patch)
tree247eed13a5231c3983e343f0b7fc2a95012353c2 /plugins/Variables/src/parse_alias.cpp
parent9d0174ebe2bd005418855b18f737c36d5c20ab4a (diff)
all another C++'11 iterators
Diffstat (limited to 'plugins/Variables/src/parse_alias.cpp')
-rw-r--r--plugins/Variables/src/parse_alias.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/Variables/src/parse_alias.cpp b/plugins/Variables/src/parse_alias.cpp
index e90595a68e..aff5f9251c 100644
--- a/plugins/Variables/src/parse_alias.cpp
+++ b/plugins/Variables/src/parse_alias.cpp
@@ -36,9 +36,9 @@ static ALIASREGISTER* searchAliasRegister(wchar_t *szAlias)
return nullptr;
mir_cslock lck(csAliasRegister);
- for (int i = 0; i < arAliases.getCount(); i++)
- if (!mir_wstrcmp(arAliases[i]->szAlias, szAlias))
- return arAliases[i];
+ for (auto &it : arAliases)
+ if (!mir_wstrcmp(it->szAlias, szAlias))
+ return it;
return nullptr;
}
@@ -93,8 +93,7 @@ static int addToAliasRegister(wchar_t *szAlias, unsigned int argc, wchar_t** arg
return -1;
mir_cslock lck(csAliasRegister);
- for (int i = 0; i < arAliases.getCount(); i++) {
- ALIASREGISTER *p = arAliases[i];
+ for (auto &p : arAliases) {
if (mir_wstrcmp(p->szAlias, szAlias))
continue;
@@ -194,8 +193,7 @@ void registerAliasTokens()
void unregisterAliasTokens()
{
- for (int i = 0; i < arAliases.getCount(); i++) {
- ALIASREGISTER *p = arAliases[i];
+ for (auto &p : arAliases) {
for (unsigned j = 0; j < p->argc; j++)
mir_free(p->argv[j]);
mir_free(p->argv);