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

Unified Diff: net/base/x509_certificate_openssl.cc

Issue 3968001: Update code that previously constructed strings from string iterators only to... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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: net/base/x509_certificate_openssl.cc
===================================================================
--- net/base/x509_certificate_openssl.cc (revision 63369)
+++ net/base/x509_certificate_openssl.cc (working copy)
@@ -128,20 +128,26 @@
return;
base::Time::Exploded exploded = {0};
- bool valid = base::StringToInt(str_date.substr(0, year_length),
+ bool valid = base::StringToInt(str_date.begin(),
+ str_date.begin() + year_length,
&exploded.year);
if (valid && year_length == 2)
exploded.year += exploded.year < 50 ? 2000 : 1900;
- valid &= base::StringToInt(str_date.substr(2 + fields_offset, 2),
+ valid &= base::StringToInt(str_date.begin() + fields_offset + 2,
+ str_date.begin() + fields_offset + 4,
&exploded.month);
- valid &= base::StringToInt(str_date.substr(4 + fields_offset, 2),
+ valid &= base::StringToInt(str_date.begin() + fields_offset + 4,
+ str_date.begin() + fields_offset + 6),
&exploded.day_of_month);
- valid &= base::StringToInt(str_date.substr(6 + fields_offset, 2),
+ valid &= base::StringToInt(str_date.begin() + fields_offset + 6,
+ str_date.begin() + fields_offset + 8),
&exploded.hour);
- valid &= base::StringToInt(str_date.substr(8 + fields_offset, 2),
+ valid &= base::StringToInt(str_date.begin() + fields_offset + 8,
+ str_date.begin() + fields_offset + 10),
&exploded.minute);
- valid &= base::StringToInt(str_date.substr(10 + fields_offset, 2),
+ valid &= base::StringToInt(str_date.begin() + fields_offset + 10,
+ str_date.begin() + fields_offset + 12,
&exploded.second);
DCHECK(valid);
Property changes on: net\base\x509_certificate_openssl.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698