Chromium Code Reviews| Index: runtime/bin/socket_impl.dart |
| =================================================================== |
| --- runtime/bin/socket_impl.dart (revision 3627) |
| +++ runtime/bin/socket_impl.dart (working copy) |
| @@ -309,12 +309,14 @@ |
| // When using the Dart C API access to ObjectArray by index is |
|
cshapiro
2012/01/28 02:25:48
Same comments in file_impl.dart apply here.
Anders Johnsen
2012/01/30 21:15:28
Done.
|
| // currently much faster. This function will make a copy of the |
| // supplied List to an ObjectArray if it isn't already. |
| - ObjectArray outBuffer; |
| + List<int> outBuffer; |
| int outOffset = offset; |
| if (buffer is ObjectArray) { |
| outBuffer = buffer; |
| + } else if (buffer is ByteArray) { |
| + outBuffer = buffer; |
| } else { |
| - outBuffer = new ObjectArray(bytes); |
| + outBuffer = new ByteArray(bytes); |
| outOffset = 0; |
| int j = offset; |
| for (int i = 0; i < bytes; i++) { |