Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: extensions/browser/api/socket/udp_socket.cc

Issue 2950263003: Use ContainsValue() instead of std::find() in extensions/ (Closed)
Patch Set: Rebase patch. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/socket/udp_socket.cc
diff --git a/extensions/browser/api/socket/udp_socket.cc b/extensions/browser/api/socket/udp_socket.cc
index 90aefe78ee2edd561d0ea46d689bd9d5e4b9016c..d4100aff54cf441f85d33dfc9f8a6b4b7caacc49 100644
--- a/extensions/browser/api/socket/udp_socket.cc
+++ b/extensions/browser/api/socket/udp_socket.cc
@@ -8,6 +8,7 @@
#include "base/callback_helpers.h"
#include "base/lazy_instance.h"
+#include "base/stl_util.h"
#include "extensions/browser/api/api_resource.h"
#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
@@ -260,9 +261,7 @@ int UDPSocket::JoinGroup(const std::string& address) {
return net::ERR_ADDRESS_INVALID;
std::string normalized_address = ip.ToString();
- std::vector<std::string>::iterator find_result = std::find(
- multicast_groups_.begin(), multicast_groups_.end(), normalized_address);
- if (find_result != multicast_groups_.end())
+ if (base::ContainsValue(multicast_groups_, normalized_address))
return net::ERR_ADDRESS_INVALID;
int rv = socket_.JoinGroup(ip);
« no previous file with comments | « extensions/browser/api/management/management_api.cc ('k') | extensions/browser/api/web_request/web_request_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698