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

Unified Diff: runtime/lib/string_patch.dart

Issue 16654007: Delete some dead code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_patch.dart
===================================================================
--- runtime/lib/string_patch.dart (revision 23830)
+++ runtime/lib/string_patch.dart (working copy)
@@ -467,75 +467,6 @@
String toLowerCase() native "String_toLowerCase";
- // Implementations of Strings methods follow below.
- static String join(Iterable<String> strings, String separator) {
- bool first = true;
- List<String> stringsList = <String>[];
- for (String string in strings) {
- if (first) {
- first = false;
- } else {
- stringsList.add(separator);
- }
-
- if (string is! String) {
- throw new ArgumentError(Error.safeToString(string));
- }
- stringsList.add(string);
- }
- return concatAll(stringsList);
- }
-
- static String concatAll(Iterable<String> strings) {
- _ObjectArray stringsArray;
- final len = strings.length;
- bool isOneByteString = true;
- int totalLength = 0;
- if (strings._cid == _ObjectArray._clCId) {
- stringsArray = strings;
- for (int i = 0; i < len; i++) {
- var string = strings[i];
- if (string._cid == _OneByteString._classId) {
- totalLength += string.length;
- } else {
- isOneByteString = false;
- if (string is! String) throw new ArgumentError(string);
- }
- }
- } else {
- // Copy into an _ObjectArray.
- stringsArray = new _ObjectArray(len);
- int i = 0;
- for (int i = 0; i < len; i++) {
- var string = strings[i];
- if (string._cid == _OneByteString.clCid) {
- totalLength += s.length;
- } else {
- isOneByteString = false;
- if (string is! String) throw new ArgumentError(string);
- }
- stringsArray[i++] = string;
- }
- }
- if (isOneByteString) {
- return _OneByteString._concatAll(stringsArray, totalLength);
- }
- return _concatAllNative(stringsArray);
- }
-
- static String _concatAll(_ObjectArray<String> strings) {
- int totalLength = 0;
- final stringsLength = strings.length;
- for (int i = 0; i < stringsLength; i++) {
- var e = strings[i];
- if (e._cid != _OneByteString._classId) {
- return _concatAllNative(strings);
- }
- totalLength += e.length;
- }
- return _OneByteString._concatAll(strings, totalLength);
- }
-
// Call this method if not all list elements are OneByteString-s.
static String _concatAllNative(_ObjectArray<String> strings)
native "Strings_concatAll";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698