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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 560113002: Narrow String::CharAt from int32_t to uint16_t. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 50ffd407d6a29b3774871a0e7f2188ee555313fb..d354726ad32fc1ed15a940ca264be2b9e9582e1f 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -2306,7 +2306,7 @@ DART_EXPORT Dart_Handle Dart_StringToUTF16(Dart_Handle str,
intptr_t str_len = str_obj.Length();
intptr_t copy_len = (str_len > *length) ? *length : str_len;
for (intptr_t i = 0; i < copy_len; i++) {
- utf16_array[i] = static_cast<uint16_t>(str_obj.CharAt(i));
+ utf16_array[i] = str_obj.CharAt(i);
}
*length = copy_len;
return Api::Success();
@@ -2373,7 +2373,7 @@ DART_EXPORT Dart_Handle Dart_MakeExternalString(Dart_Handle str,
ASSERT(length >= (copy_len * str_obj.CharSize()));
uint16_t* utf16_array = reinterpret_cast<uint16_t*>(array);
for (intptr_t i = 0; i < copy_len; i++) {
- utf16_array[i] = static_cast<uint16_t>(str_obj.CharAt(i));
+ utf16_array[i] = str_obj.CharAt(i);
}
TwoByteString::SetPeer(str_obj, peer, cback);
}
« no previous file with comments | « runtime/lib/string.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698