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

Side by Side Diff: samples/third_party/dromaeo/common/BenchUtil.dart

Issue 11266050: Rename regexp methods to getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase and update status files with co19 issue number. Created 8 years, 1 month 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 | « samples/markdown/inline_parser.dart ('k') | tests/co19/co19-dart2dart.status » ('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 // Misc benchmark-related utility functions. 5 // Misc benchmark-related utility functions.
6 6
7 class BenchUtil { 7 class BenchUtil {
8 static int get now { 8 static int get now {
9 return new Date.now().millisecondsSinceEpoch; 9 return new Date.now().millisecondsSinceEpoch;
10 } 10 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return sb.toString(); 64 return sb.toString();
65 } 65 }
66 66
67 // TODO: use corelib implementation. 67 // TODO: use corelib implementation.
68 static String replaceAll(String s, String pattern, 68 static String replaceAll(String s, String pattern,
69 String replacement(Match match)) { 69 String replacement(Match match)) {
70 StringBuffer sb = new StringBuffer(); 70 StringBuffer sb = new StringBuffer();
71 71
72 int pos = 0; 72 int pos = 0;
73 for (Match match in new RegExp(pattern).allMatches(s)) { 73 for (Match match in new RegExp(pattern).allMatches(s)) {
74 sb.add(s.substring(pos, match.start())); 74 sb.add(s.substring(pos, match.start));
75 sb.add(replacement(match)); 75 sb.add(replacement(match));
76 pos = match.end(); 76 pos = match.end;
77 } 77 }
78 sb.add(s.substring(pos)); 78 sb.add(s.substring(pos));
79 79
80 return sb.toString(); 80 return sb.toString();
81 } 81 }
82 } 82 }
OLDNEW
« no previous file with comments | « samples/markdown/inline_parser.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698