Chromium Code Reviews| 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 class SortHelper { | 5 class SortHelper { |
| 6 | 6 |
| 7 SortHelper(this.sortFunction, this.compareFunction) {} | 7 SortHelper(this.sortFunction, this.compareFunction) {} |
| 8 | 8 |
| 9 void run() { | 9 void run() { |
| 10 testSortIntLists(); | 10 testSortIntLists(); |
| 11 testSortDoubleLists(); | 11 testSortDoubleLists(); |
| 12 } | 12 } |
| 13 | 13 |
| 14 void printList(List a) { | 14 void printList(List a) { |
|
ngeoffray
2012/07/11 11:48:49
Why don't you just remove the calls to printList a
Anton Muhin
2012/07/11 11:50:34
I didn't add them, so I didn't want to remove them
ngeoffray
2012/07/11 11:53:33
I think either me or Florian :) In any case, I pre
Anton Muhin
2012/07/11 11:55:48
np, sending you a CL in a couple of mins.
On 2012
| |
| 15 if (true) return; | |
| 15 StringBuffer buffer = new StringBuffer(); | 16 StringBuffer buffer = new StringBuffer(); |
| 16 for (int i = 0; i < a.length; i++) { | 17 for (int i = 0; i < a.length; i++) { |
| 17 if (i != 0) buffer.add(","); | 18 if (i != 0) buffer.add(","); |
| 18 buffer.add(a[i]); | 19 buffer.add(a[i]); |
| 19 } | 20 } |
| 20 print("[$buffer]"); | 21 print("[$buffer]"); |
| 21 } | 22 } |
| 22 | 23 |
| 23 bool isSorted(List a) { | 24 bool isSorted(List a) { |
| 24 for (int i = 1; i < a.length; i++) { | 25 for (int i = 1; i < a.length; i++) { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 | 154 |
| 154 for (int i = 0; i < a.length; i++) { | 155 for (int i = 0; i < a.length; i++) { |
| 155 a[i] = 1.5; | 156 a[i] = 1.5; |
| 156 } | 157 } |
| 157 testSort(a); | 158 testSort(a); |
| 158 } | 159 } |
| 159 | 160 |
| 160 Function sortFunction; | 161 Function sortFunction; |
| 161 Function compareFunction; | 162 Function compareFunction; |
| 162 } | 163 } |
| OLD | NEW |