Codechange: Replaced SmallVector::Find() with std::find()

This commit is contained in:
Henry Wilson
2019-02-20 19:27:10 +00:00
committed by PeterN
parent e0c58bf5ee
commit 2bc2de9034
9 changed files with 41 additions and 37 deletions

View File

@@ -435,12 +435,8 @@ class NetworkContentListWindow : public Window, ContentCallback {
{
if (!this->content.Sort()) return;
for (ConstContentIterator iter = this->content.Begin(); iter != this->content.End(); iter++) {
if (*iter == this->selected) {
this->list_pos = iter - this->content.Begin();
break;
}
}
int idx = find_index(this->content, this->selected);
if (idx >= 0) this->list_pos = idx;
}
/** Filter content by tags/name */
@@ -478,11 +474,10 @@ class NetworkContentListWindow : public Window, ContentCallback {
if (!changed) return;
/* update list position */
for (ConstContentIterator iter = this->content.Begin(); iter != this->content.End(); iter++) {
if (*iter == this->selected) {
this->list_pos = iter - this->content.Begin();
return;
}
int idx = find_index(this->content, this->selected);
if (idx >= 0) {
this->list_pos = idx;
return;
}
/* previously selected item not in list anymore */