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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 11418004: Don't copy Int8Arrays when passing them in as lists of bytes and don't (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « no previous file | sdk/lib/io/common.dart » ('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 55c436ad034d0190c97334565f8519d06bd8880d..fb992035d27d509583377477b25f7cb44354c09a 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1950,7 +1950,8 @@ DART_EXPORT Dart_Handle Dart_ListGetAsBytes(Dart_Handle list,
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(list));
- if (obj.IsUint8Array() || obj.IsExternalUint8Array()) {
+ if (obj.IsUint8Array() || obj.IsExternalUint8Array() ||
+ obj.IsInt8Array() || obj.IsExternalInt8Array()) {
const ByteArray& byte_array = ByteArray::Cast(obj);
if (Utils::RangeCheck(offset, length, byte_array.Length())) {
ByteArray::Copy(native_array, byte_array, offset, length);
« no previous file with comments | « no previous file | sdk/lib/io/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698