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

Side by Side Diff: pkg/analysis_services/lib/src/correction/strings.dart

Issue 418203002: Implement more fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments Created 6 years, 4 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library services.src.correction.strings; 8 library services.src.correction.strings;
9 9
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 String removeStart(String str, String remove) { 51 String removeStart(String str, String remove) {
52 if (isEmpty(str) || isEmpty(remove)) { 52 if (isEmpty(str) || isEmpty(remove)) {
53 return str; 53 return str;
54 } 54 }
55 if (str.startsWith(remove)) { 55 if (str.startsWith(remove)) {
56 return str.substring(remove.length); 56 return str.substring(remove.length);
57 } 57 }
58 return str; 58 return str;
59 } 59 }
60 60
61 int compareStrings(String a, String b) {
62 if (a == b) {
63 return 0;
64 }
65 if (a == null) {
66 return 1;
67 }
68 if (b == null) {
69 return -1;
70 }
71 return a.compareTo(b);
72 }
73
61 String repeat(String s, int n) { 74 String repeat(String s, int n) {
62 StringBuffer sb = new StringBuffer(); 75 StringBuffer sb = new StringBuffer();
63 for (int i = 0; i < n; i++) { 76 for (int i = 0; i < n; i++) {
64 sb.write(s); 77 sb.write(s);
65 } 78 }
66 return sb.toString(); 79 return sb.toString();
67 } 80 }
OLDNEW
« no previous file with comments | « pkg/analysis_services/lib/src/correction/source_buffer.dart ('k') | pkg/analysis_services/lib/src/correction/util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698