| OLD | NEW |
| 1 dart_library.library('collection/algorithms', null, /* Imports */[ | 1 dart_library.library('collection/algorithms', null, /* Imports */[ |
| 2 "dart/_runtime", | 2 "dart/_runtime", |
| 3 'dart/core', | 3 'dart/core', |
| 4 'dart/math' | 4 'dart/math' |
| 5 ], /* Lazy imports */[ | 5 ], /* Lazy imports */[ |
| 6 ], function(exports, dart, core, math) { | 6 ], function(exports, dart, core, math) { |
| 7 'use strict'; | 7 'use strict'; |
| 8 let dartx = dart.dartx; | 8 let dartx = dart.dartx; |
| 9 function _comparableBinarySearch(list, key) { | 9 function _comparableBinarySearch(list, key) { |
| 10 let min = 0; | 10 let min = 0; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 max = mid; | 105 max = mid; |
| 106 } else { | 106 } else { |
| 107 min = dart.notNull(mid) + 1; | 107 min = dart.notNull(mid) + 1; |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 list[dartx.setRange](dart.notNull(min) + 1, dart.notNull(pos) + 1, list, m
in); | 110 list[dartx.setRange](dart.notNull(min) + 1, dart.notNull(pos) + 1, list, m
in); |
| 111 list[dartx.set](min, element); | 111 list[dartx.set](min, element); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 dart.fn(_insertionSort, dart.void, [core.List, dart.functionType(core.int, [da
rt.dynamic, dart.dynamic]), core.int, core.int, core.int]); | 114 dart.fn(_insertionSort, dart.void, [core.List, dart.functionType(core.int, [da
rt.dynamic, dart.dynamic]), core.int, core.int, core.int]); |
| 115 let _MERGE_SORT_LIMIT = 32; | 115 const _MERGE_SORT_LIMIT = 32; |
| 116 function mergeSort(list, opts) { | 116 function mergeSort(list, opts) { |
| 117 let start = opts && 'start' in opts ? opts.start : 0; | 117 let start = opts && 'start' in opts ? opts.start : 0; |
| 118 let end = opts && 'end' in opts ? opts.end : null; | 118 let end = opts && 'end' in opts ? opts.end : null; |
| 119 let compare = opts && 'compare' in opts ? opts.compare : null; | 119 let compare = opts && 'compare' in opts ? opts.compare : null; |
| 120 if (end == null) | 120 if (end == null) |
| 121 end = list[dartx.length]; | 121 end = list[dartx.length]; |
| 122 if (compare == null) | 122 if (compare == null) |
| 123 compare = core.Comparable.compare; | 123 compare = core.Comparable.compare; |
| 124 let length = dart.notNull(end) - dart.notNull(start); | 124 let length = dart.notNull(end) - dart.notNull(start); |
| 125 if (dart.notNull(length) < 2) | 125 if (dart.notNull(length) < 2) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 target[dartx.setRange](targetOffset, dart.notNull(targetOffset) + (dart.notN
ull(secondEnd) - dart.notNull(cursor2)), secondList, cursor2); | 235 target[dartx.setRange](targetOffset, dart.notNull(targetOffset) + (dart.notN
ull(secondEnd) - dart.notNull(cursor2)), secondList, cursor2); |
| 236 } | 236 } |
| 237 dart.fn(_merge, dart.void, [dart.functionType(core.int, [dart.dynamic, dart.dy
namic]), core.List, core.int, core.int, core.List, core.int, core.int, core.List
, core.int]); | 237 dart.fn(_merge, dart.void, [dart.functionType(core.int, [dart.dynamic, dart.dy
namic]), core.List, core.int, core.int, core.List, core.int, core.int, core.List
, core.int]); |
| 238 // Exports: | 238 // Exports: |
| 239 exports.binarySearch = binarySearch; | 239 exports.binarySearch = binarySearch; |
| 240 exports.shuffle = shuffle; | 240 exports.shuffle = shuffle; |
| 241 exports.reverse = reverse; | 241 exports.reverse = reverse; |
| 242 exports.insertionSort = insertionSort; | 242 exports.insertionSort = insertionSort; |
| 243 exports.mergeSort = mergeSort; | 243 exports.mergeSort = mergeSort; |
| 244 }); | 244 }); |
| OLD | NEW |