| 55 | } |
| 56 | |
| 57 | static Real SortThreeDescending(Real* a, Real* b, Real* c) |
| 58 | { |
| 59 | // sort *a, *b, *c; return *b; optimise for already sorted |
| 60 | if (*a >= *b) |
| 61 | { |
| 62 | if (*b >= *c) { REPORT return *b; } |
| 63 | else if (*a >= *c) { REPORT Real x = *c; *c = *b; *b = x; return x; } |
| 64 | else { REPORT Real x = *a; *a = *c; *c = *b; *b = x; return x; } |
| 65 | } |
| 66 | else if (*c >= *b) { REPORT Real x = *c; *c = *a; *a = x; return *b; } |
| 67 | else if (*a >= *c) { REPORT Real x = *a; *a = *b; *b = x; return x; } |
| 68 | else { REPORT Real x = *c; *c = *a; *a = *b; *b = x; return x; } |
| 69 | } |
| 70 | |
| 71 | static void InsertionSortDescending(Real* first, const int length, |
| 72 | int guard) |
no outgoing calls
no test coverage detected