diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-26 22:31:20 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-26 22:31:27 +0300 |
commit | 391980ce1e890445542441eeb5d9f9cc18ae1baf (patch) | |
tree | ee1b165175dcdaeeaabd2ddb822542e648663a90 /plugins/IEView/src/Template.cpp | |
parent | bf8ad124d03b4fd059318d9ba8889b11faaf5b53 (diff) |
code optimization
Diffstat (limited to 'plugins/IEView/src/Template.cpp')
-rw-r--r-- | plugins/IEView/src/Template.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/IEView/src/Template.cpp b/plugins/IEView/src/Template.cpp index 708abda305..c171a141c1 100644 --- a/plugins/IEView/src/Template.cpp +++ b/plugins/IEView/src/Template.cpp @@ -338,12 +338,12 @@ TemplateMap* TemplateMap::loadTemplateFile(const char *id, const char *filename, if (sscanf(store, "%s", tmp2) == EOF) continue;
//template start
bool bFound = false;
- for (unsigned i = 0; i < _countof(templateNames); i++) {
- if (!strncmp(store, templateNames[i].tokenString, templateNames[i].tokenLen)) {
+ for (auto &it : templateNames)
+ if (!strncmp(store, it.tokenString, it.tokenLen)) {
bFound = true;
break;
}
- }
+
if (bFound) {
if (wasTemplate)
tmap->addTemplate(lastTemplate, templateText);
@@ -365,16 +365,16 @@ TemplateMap* TemplateMap::loadTemplateFile(const char *id, const char *filename, "MessageOutGroupStart", "MessageOutGroupInner",
"hMessageOutGroupStart", "hMessageOutGroupInner" };
tmap->m_grouping = true;
- for (int i = 0; i < _countof(groupTemplates); i++) {
- if (tmap->getTemplate(groupTemplates[i]) == nullptr) {
+ for (auto &it : groupTemplates) {
+ if (tmap->getTemplate(it) == nullptr) {
tmap->m_grouping = false;
break;
}
}
static const char *rtlTemplates[] = { "MessageInRTL", "MessageOutRTL" }; //"HTMLStartRTL",
tmap->m_rtl = true;
- for (int i = 0; i < _countof(rtlTemplates); i++) {
- if (tmap->getTemplate(rtlTemplates[i]) == nullptr) {
+ for (auto &it : rtlTemplates) {
+ if (tmap->getTemplate(it) == nullptr) {
tmap->m_rtl = false;
break;
}
|