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

Unified Diff: runtime/vm/object.cc

Issue 381603002: Address comments on double-parse implementation from earlier CL. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
« no previous file with comments | « runtime/lib/string_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index d83e40d5d8664cf8b84c0b10c3e5e3b59e459d17..ab6711aaf436ab6ad1d8c44eb91b6104dac8cbdb 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -16927,7 +16927,7 @@ bool String::ParseDouble(const String& str,
ASSERT(0 <= start);
ASSERT(start <= end);
ASSERT(end <= str.Length());
- int length = end - start;
+ intptr_t length = end - start;
NoGCScope no_gc;
const uint8_t* startChar;
if (str.IsOneByteString()) {
@@ -16936,8 +16936,9 @@ bool String::ParseDouble(const String& str,
startChar = ExternalOneByteString::CharAddr(str, start);
} else {
uint8_t* chars = Isolate::Current()->current_zone()->Alloc<uint8_t>(length);
- for (int i = 0; i < length; i++) {
- int ch = str.CharAt(start + i);
+ const Scanner::CharAtFunc char_at = str.CharAtFunc();
+ for (intptr_t i = 0; i < length; i++) {
+ int32_t ch = char_at(str, start + i);
if (ch < 128) {
chars[i] = ch;
} else {
« no previous file with comments | « runtime/lib/string_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698