comparison src/share/vm/utilities/quickSort.cpp @ 10283:e484fe2abebd

Merge
author twisti
date Thu, 16 May 2013 13:47:55 -0700
parents f9be75d21404 e76dd894b984
children 836a62f43af9 78bbf4d43a14
comparison
equal deleted inserted replaced
10272:513a5298c1dd 10283:e484fe2abebd
32 #include "utilities/quickSort.hpp" 32 #include "utilities/quickSort.hpp"
33 #include "memory/allocation.hpp" 33 #include "memory/allocation.hpp"
34 #include "memory/allocation.inline.hpp" 34 #include "memory/allocation.inline.hpp"
35 #include <stdlib.h> 35 #include <stdlib.h>
36 36
37 #ifdef ASSERT
37 static int test_comparator(int a, int b) { 38 static int test_comparator(int a, int b) {
38 if (a == b) { 39 if (a == b) {
39 return 0; 40 return 0;
40 } 41 }
41 if (a < b) { 42 if (a < b) {
42 return -1; 43 return -1;
43 } 44 }
44 return 1; 45 return 1;
45 } 46 }
47 #endif // ASSERT
46 48
47 static int test_even_odd_comparator(int a, int b) { 49 static int test_even_odd_comparator(int a, int b) {
48 bool a_is_odd = (a % 2) == 1; 50 bool a_is_odd = (a % 2) == 1;
49 bool b_is_odd = (b % 2) == 1; 51 bool b_is_odd = (b % 2) == 1;
50 if (a_is_odd == b_is_odd) { 52 if (a_is_odd == b_is_odd) {