Codechange: Replaced SmallVector::[Begin|End]() with std alternatives

This commit is contained in:
Henry Wilson
2019-02-17 11:20:52 +00:00
committed by PeterN
parent 297fd3dda3
commit ab711e6942
75 changed files with 464 additions and 555 deletions

View File

@@ -91,9 +91,8 @@ void StringFilter::SetFilterTerm(const char *str)
void StringFilter::ResetState()
{
this->word_matches = 0;
const WordState *end = this->word_index.End();
for (WordState *it = this->word_index.Begin(); it != end; ++it) {
it->match = false;
for (WordState &ws : this->word_index) {
ws.match = false;
}
}
@@ -110,11 +109,10 @@ void StringFilter::AddLine(const char *str)
if (str == NULL) return;
bool match_case = this->case_sensitive != NULL && *this->case_sensitive;
const WordState *end = this->word_index.End();
for (WordState *it = this->word_index.Begin(); it != end; ++it) {
if (!it->match) {
if ((match_case ? strstr(str, it->start) : strcasestr(str, it->start)) != NULL) {
it->match = true;
for (WordState &ws : this->word_index) {
if (!ws.match) {
if ((match_case ? strstr(str, ws.start) : strcasestr(str, ws.start)) != NULL) {
ws.match = true;
this->word_matches++;
}
}