Codechange: Replaced SmallVector::Find() with std::find()
This commit is contained in:
@@ -136,7 +136,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // Wi
|
||||
memcpy(&address, &ifo[j].iiAddress.Address, sizeof(sockaddr));
|
||||
((sockaddr_in*)&address)->sin_addr.s_addr = ifo[j].iiAddress.AddressIn.sin_addr.s_addr | ~ifo[j].iiNetmask.AddressIn.sin_addr.s_addr;
|
||||
NetworkAddress addr(address, sizeof(sockaddr));
|
||||
if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) *broadcast->Append() = addr;
|
||||
if (std::none_of(broadcast->begin(), broadcast->end(), [&addr](NetworkAddress const& elem) -> bool { return elem == addr; })) broadcast->push_back(addr);
|
||||
}
|
||||
|
||||
free(ifo);
|
||||
|
@@ -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 */
|
||||
|
Reference in New Issue
Block a user