Chromium Code Reviews| Index: src/dateparser.h |
| =================================================================== |
| --- src/dateparser.h (revision 5888) |
| +++ src/dateparser.h (working copy) |
| @@ -87,6 +87,19 @@ |
| return n; |
| } |
| + // Read a string of digits as an unsigned number of milliseconds (cap just |
| + // below kMaxInt). |
| + int ReadMilliseconds() { |
|
Lasse Reichstein
2010/11/25 10:17:19
Seems like overkill (and potentially fragile) to r
|
| + has_read_number_ = true; |
| + int n; |
| + int i = 0; |
| + for (n = 0; IsAsciiDigit() && n < kMaxInt / 10 - 1 && i < 3; Next()) { |
| + n = n * 10 + ch_ - '0'; |
| + i++; |
| + } |
| + return n * pow(10, 3 - i); |
| + } |
| + |
| // Read a word (sequence of chars. >= 'A'), fill the given buffer with a |
| // lower-case prefix, and pad any remainder of the buffer with zeroes. |
| // Return word length. |