| 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 /** | 5 /** |
| 6 * Dual-Pivot Quicksort algorithm. | 6 * Dual-Pivot Quicksort algorithm. |
| 7 * | 7 * |
| 8 * This class implements the dual-pivot quicksort algorithm as presented in | 8 * This class implements the dual-pivot quicksort algorithm as presented in |
| 9 * Vladimir Yaroslavskiy's paper. | 9 * Vladimir Yaroslavskiy's paper. |
| 10 * | 10 * |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } else { | 333 } else { |
| 334 // The second partition looks as follows: | 334 // The second partition looks as follows: |
| 335 // [ * | >= pivot1 && <= pivot2 | * ] | 335 // [ * | >= pivot1 && <= pivot2 | * ] |
| 336 // ^ ^ | 336 // ^ ^ |
| 337 // less great | 337 // less great |
| 338 // Simply sort it by recursive descent. | 338 // Simply sort it by recursive descent. |
| 339 _doSort(a, less, great, compare); | 339 _doSort(a, less, great, compare); |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 } | 342 } |
| OLD | NEW |