when a permutation is done.
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
bool sortFirst(int* array, int length) {
bool rt = false;
bool sortFirst(int* array, int length) {
bool rt = false;
+ // This loop could probably be replaced by a while loop with conditions
+ // on the array values permutation AND the iteration value, later ...
for (int i = 0; i < length-1; i++) {
if (array[i] > array[i+1]) {
swap(&array[i], &array[i+1]);
//xorSwap(&array[i], &array[i+1]);
for (int i = 0; i < length-1; i++) {
if (array[i] > array[i+1]) {
swap(&array[i], &array[i+1]);
//xorSwap(&array[i], &array[i+1]);
+ if (!rt) { rt = true; };