summaryrefslogtreecommitdiffstats
path: root/net/base/net_util.cc
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 16:05:47 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 16:05:47 +0000
commitc2750c67ca3a672018bac2dfb07628d079aafc8d (patch)
tree8bbff1c4c3aeb363e06734e91e172653e34737cc /net/base/net_util.cc
parent213b99ad9d66e3c039bbb90c19d78603975c1be9 (diff)
downloadchromium_src-c2750c67ca3a672018bac2dfb07628d079aafc8d.zip
chromium_src-c2750c67ca3a672018bac2dfb07628d079aafc8d.tar.gz
chromium_src-c2750c67ca3a672018bac2dfb07628d079aafc8d.tar.bz2
Update code that previously constructed strings from string iterators only to use StringToInt. These usages now pass the iterators directly to the new StringToInt overloads.
BUG=None TEST=All Review URL: http://codereview.chromium.org/3968001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.cc')
-rw-r--r--net/base/net_util.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 45dc60c..8f6b2af 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1676,10 +1676,11 @@ void SetExplicitlyAllowedPorts(const std::string& allowed_ports) {
(allowed_ports[i] != kComma))
return;
if (i == size || allowed_ports[i] == kComma) {
- size_t length = i - last;
- if (length > 0) {
+ if (i > last) {
int port;
- base::StringToInt(allowed_ports.substr(last, length), &port);
+ base::StringToInt(allowed_ports.begin() + last,
+ allowed_ports.begin() + i,
+ &port);
ports.insert(port);
}
last = i + 1;