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

Side by Side Diff: runtime/lib/string.dart

Issue 8972005: More optimizations cleanup. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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 | « no previous file | runtime/vm/code_generator.h » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * [StringBase] contains common methods used by concrete String implementations, 6 * [StringBase] contains common methods used by concrete String implementations,
7 * e.g., OneByteString. 7 * e.g., OneByteString.
8 */ 8 */
9 class StringBase { 9 class StringBase {
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 String concat(String other) native "String_concat"; 49 String concat(String other) native "String_concat";
50 50
51 String toString() { 51 String toString() {
52 return this; 52 return this;
53 } 53 }
54 54
55 bool operator ==(Object other) { 55 bool operator ==(Object other) {
56 if (this === other) { 56 if (this === other) {
57 return true; 57 return true;
58 } 58 }
59 if (!(other is String) || 59 if ((other is !String) ||
60 (this.length != other.length)) { 60 (this.length != other.length)) {
61 // TODO(5413632): Compare hash codes when both are present. 61 // TODO(5413632): Compare hash codes when both are present.
62 return false; 62 return false;
63 } 63 }
64 return this.compareTo(other) === 0; 64 return this.compareTo(other) === 0;
65 } 65 }
66 66
67 int compareTo(String other) { 67 int compareTo(String other) {
68 int thisLength = this.length; 68 int thisLength = this.length;
69 int otherLength = other.length; 69 int otherLength = other.length;
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 for (int g in groups) { 514 for (int g in groups) {
515 result.add(group(g)); 515 result.add(group(g));
516 } 516 }
517 return result; 517 return result;
518 } 518 }
519 519
520 final int _start; 520 final int _start;
521 final String str; 521 final String str;
522 final String pattern; 522 final String pattern;
523 } 523 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698