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

Side by Side Diff: pkg/analyzer/lib/src/generated/java_core.dart

Issue 712083003: Create fewer unnecessary lists (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « pkg/analyzer/lib/src/generated/html.dart ('k') | pkg/analyzer/lib/src/generated/parser.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 library java.core; 1 library java.core;
2 2
3 final Stopwatch nanoTimeStopwatch = new Stopwatch(); 3 final Stopwatch nanoTimeStopwatch = new Stopwatch();
4 4
5 const int LONG_MAX_VALUE = 0x7fffffffffffffff; 5 const int LONG_MAX_VALUE = 0x7fffffffffffffff;
6 6
7 class JavaSystem { 7 class JavaSystem {
8 static int currentTimeMillis() { 8 static int currentTimeMillis() {
9 return (new DateTime.now()).millisecondsSinceEpoch; 9 return (new DateTime.now()).millisecondsSinceEpoch;
10 } 10 }
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 return formatList(pattern, [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7]); 413 return formatList(pattern, [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7]);
414 } 414 }
415 415
416 /** 416 /**
417 * Inserts the given [args] into [pattern]. 417 * Inserts the given [args] into [pattern].
418 * 418 *
419 * format('Hello, {0}!', ['John']) = 'Hello, John!' 419 * format('Hello, {0}!', ['John']) = 'Hello, John!'
420 * format('{0} are you {1}ing?', ['How', 'do']) = 'How are you doing?' 420 * format('{0} are you {1}ing?', ['How', 'do']) = 'How are you doing?'
421 * format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?' 421 * format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?'
422 */ 422 */
423 String formatList(String pattern, List args) { 423 String formatList(String pattern, List<Object> arguments) {
424 if (arguments == null || arguments.isEmpty) {
425 return pattern;
426 }
424 return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) { 427 return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) {
425 String indexStr = match.group(1); 428 String indexStr = match.group(1);
426 int index = int.parse(indexStr); 429 int index = int.parse(indexStr);
427 var arg = args[index]; 430 Object arg = arguments[index];
428 return arg != null ? arg.toString() : null; 431 return arg != null ? arg.toString() : null;
429 }); 432 });
430 } 433 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/html.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698