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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 { 152 {
153 auto domains = GetDomains(); 153 auto domains = GetDomains();
154 if (!domains || docDomain.empty() || (*domains)[DEFAULT_DOMAIN]) 154 if (!domains || docDomain.empty() || (*domains)[DEFAULT_DOMAIN])
155 return false; 155 return false;
156 156
157 docDomain.toLower(); 157 docDomain.toLower();
158 158
159 String::size_type len = docDomain.length(); 159 String::size_type len = docDomain.length();
160 if (len > 0 && mIgnoreTrailingDot && docDomain[len - 1] == '.') 160 if (len > 0 && mIgnoreTrailingDot && docDomain[len - 1] == '.')
161 docDomain.reset(docDomain, 0, len - 1); 161 docDomain.reset(docDomain, 0, len - 1);
162 for (auto it = domains->begin(); it != domains->end(); ++it) 162 for (const auto& item : *domains)
163 { 163 {
164 if (!it->second || it->first.equals(docDomain)) 164 if (!item.second || item.first.equals(docDomain))
165 continue; 165 continue;
166 166
167 size_t len1 = it->first.length(); 167 size_t len1 = item.first.length();
168 size_t len2 = docDomain.length(); 168 size_t len2 = docDomain.length();
169 if (len1 > len2 && 169 if (len1 > len2 &&
170 DependentString(it->first, len1 - len2).equals(docDomain) && 170 DependentString(item.first, len1 - len2).equals(docDomain) &&
171 it->first[len1 - len2 - 1] == u'.') 171 item.first[len1 - len2 - 1] == u'.')
172 { 172 {
173 continue; 173 continue;
174 } 174 }
175 175
176 return false; 176 return false;
177 } 177 }
178 return true; 178 return true;
179 } 179 }
180 180
181 bool ActiveFilter::IsGeneric() const 181 bool ActiveFilter::IsGeneric() const
(...skipping 16 matching lines...) Expand all
198 result.append(u'\n'); 198 result.append(u'\n');
199 } 199 }
200 if (mLastHit) 200 if (mLastHit)
201 { 201 {
202 result.append(u"lastHit="_str); 202 result.append(u"lastHit="_str);
203 result.append(to_string(mLastHit)); 203 result.append(to_string(mLastHit));
204 result.append(u'\n'); 204 result.append(u'\n');
205 } 205 }
206 return result; 206 return result;
207 } 207 }
OLDNEW

Powered by Google App Engine
This is Rietveld