From: Jérôme Benoit Date: Mon, 13 Mar 2017 14:02:15 +0000 (+0100) Subject: TP 11 exo1: affecting a value cost less than branching X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c944d83b743f75264d017b47bc388962c51f2d3e;p=TD_C.git TP 11 exo1: affecting a value cost less than branching Signed-off-by: Jérôme Benoit --- diff --git a/TP_13/exo1/lib/sort.c b/TP_13/exo1/lib/sort.c index 0fdb0be..70a766b 100644 --- a/TP_13/exo1/lib/sort.c +++ b/TP_13/exo1/lib/sort.c @@ -22,7 +22,7 @@ static bool sort_first(int* array, unsigned length, criteria_cb criteria) { for (unsigned i = 0; i < length-1; i++) { if (criteria(array[i], array[i+1])) { swap_int(&array[i], &array[i+1]); - if (!rt) { rt = true; }; + rt = true; } } return rt;