| OLD | NEW |
| 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 part of "internal.dart"; | 5 part of dart._internal; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Dual-Pivot Quicksort algorithm. | 8 * Dual-Pivot Quicksort algorithm. |
| 9 * | 9 * |
| 10 * This class implements the dual-pivot quicksort algorithm as presented in | 10 * This class implements the dual-pivot quicksort algorithm as presented in |
| 11 * Vladimir Yaroslavskiy's paper. | 11 * Vladimir Yaroslavskiy's paper. |
| 12 * | 12 * |
| 13 * Some improvements have been copied from Android's implementation. | 13 * Some improvements have been copied from Android's implementation. |
| 14 */ | 14 */ |
| 15 class Sort { | 15 class Sort { |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 } else { | 376 } else { |
| 377 // The second partition looks as follows: | 377 // The second partition looks as follows: |
| 378 // [ * | >= pivot1 && <= pivot2 | * ] | 378 // [ * | >= pivot1 && <= pivot2 | * ] |
| 379 // ^ ^ | 379 // ^ ^ |
| 380 // less great | 380 // less great |
| 381 // Simply sort it by recursive descent. | 381 // Simply sort it by recursive descent. |
| 382 _doSort(a, less, great, compare); | 382 _doSort(a, less, great, compare); |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 } | 385 } |
| OLD | NEW |