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

Side by Side Diff: sdk/lib/internal/internal.dart

Issue 856053002: Let Uint16List.setRange detect a String.codeUnits object, and copy directly from the string. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/js_string.dart ('k') | tests/standalone/typed_data_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart._internal; 5 library dart._internal;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'dart:core' hide Symbol; 9 import 'dart:core' hide Symbol;
10 import 'dart:core' as core; 10 import 'dart:core' as core;
(...skipping 27 matching lines...) Expand all
38 100000000000000.0, 38 100000000000000.0,
39 1000000000000000.0, /* 15 */ 39 1000000000000000.0, /* 15 */
40 10000000000000000.0, 40 10000000000000000.0,
41 100000000000000000.0, 41 100000000000000000.0,
42 1000000000000000000.0, 42 1000000000000000000.0,
43 10000000000000000000.0, 43 10000000000000000000.0,
44 100000000000000000000.0, /* 20 */ 44 100000000000000000000.0, /* 20 */
45 1000000000000000000000.0, 45 1000000000000000000000.0,
46 10000000000000000000000.0, 46 10000000000000000000000.0,
47 ]; 47 ];
48
49 /**
50 * An [Iterable] of the UTF-16 code units of a [String] in index order.
51 */
52 class CodeUnits extends UnmodifiableListBase<int> {
53 /** The string that this is the code units of. */
54 final String _string;
55
56 CodeUnits(this._string);
57
58 int get length => _string.length;
59 int operator[](int i) => _string.codeUnitAt(i);
60
61 static String stringOf(CodeUnits u) => u._string;
62 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/js_string.dart ('k') | tests/standalone/typed_data_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698