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

Unified Diff: dart/frog/leg/lib/dual_pivot_quicksort.dart

Issue 9537009: Create mock versions set and sort implementations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: dart/frog/leg/lib/dual_pivot_quicksort.dart
diff --git a/dart/frog/leg/lib/dual_pivot_quicksort.dart b/dart/frog/leg/lib/dual_pivot_quicksort.dart
index c822ef84268ce60dfdf68fea8f90faba7f3e5465..d2cee58d261d43c7378ecc1b066c1a98354d9b63 100644
--- a/dart/frog/leg/lib/dual_pivot_quicksort.dart
+++ b/dart/frog/leg/lib/dual_pivot_quicksort.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// TODO(ahe): Remove this file and use the shared one.
+
/**
* Dual-Pivot Quicksort algorithm.
*
@@ -135,8 +137,8 @@ class DualPivotQuicksort {
for (int k = less; k <= great; k++) {
var ak = a[k];
int comp = compare(ak, pivot);
- if (comp == 0) continue;
- if (comp < 0) {
+ if (comp == 0) {
+ } else if (comp < 0) {
if (k != less) {
a[k] = a[less];
a[less] = ak;
@@ -158,7 +160,7 @@ class DualPivotQuicksort {
great--;
// This is the only location in the while-loop where a new
// iteration is started.
- continue;
+ // continue;
} else if (comp < 0) {
// Triple exchange.
a[k] = a[less];
@@ -213,7 +215,7 @@ class DualPivotQuicksort {
if (great < k) break;
// This is the only location inside the loop where a new
// iteration is started.
- continue;
+ // continue;
} else {
// a[great] <= pivot2.
comp = compare(a[great], pivot1);
@@ -303,7 +305,7 @@ class DualPivotQuicksort {
if (great < k) break;
// This is the only location inside the loop where a new
// iteration is started.
- continue;
+ // continue;
} else {
// a[great] < pivot2.
comp = compare(a[great], pivot1);

Powered by Google App Engine
This is Rietveld 408576698