Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/filter/ActiveFilter.cpp

Issue 29404555: Noissue - Use iterators syntax consistently (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Created April 6, 2017, 8 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiled/filter/ActiveFilter.cpp
===================================================================
--- a/compiled/filter/ActiveFilter.cpp
+++ b/compiled/filter/ActiveFilter.cpp
@@ -154,26 +154,26 @@ bool ActiveFilter::IsActiveOnlyOnDomain(
if (!domains || docDomain.empty() || (*domains)[DEFAULT_DOMAIN])
return false;
docDomain.toLower();
String::size_type len = docDomain.length();
if (len > 0 && mIgnoreTrailingDot && docDomain[len - 1] == '.')
docDomain.reset(docDomain, 0, len - 1);
- for (auto it = domains->begin(); it != domains->end(); ++it)
+ for (const auto& item : *domains)
{
- if (!it->second || it->first.equals(docDomain))
+ if (!item.second || item.first.equals(docDomain))
continue;
- size_t len1 = it->first.length();
+ size_t len1 = item.first.length();
size_t len2 = docDomain.length();
if (len1 > len2 &&
- DependentString(it->first, len1 - len2).equals(docDomain) &&
- it->first[len1 - len2 - 1] == u'.')
+ DependentString(item.first, len1 - len2).equals(docDomain) &&
+ item.first[len1 - len2 - 1] == u'.')
{
continue;
}
return false;
}
return true;
}

Powered by Google App Engine
This is Rietveld