From 9861d3940b60068f12d4e5754eadab372453f37b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 2 Apr 2017 18:09:14 +0200 Subject: [PATCH] TP5: Fix a FIXME in a linked list function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TP5/exo4/liste_chainee.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/TP5/exo4/liste_chainee.c b/TP5/exo4/liste_chainee.c index 851e354..b7fa6d0 100644 --- a/TP5/exo4/liste_chainee.c +++ b/TP5/exo4/liste_chainee.c @@ -80,14 +80,9 @@ void visualiser_iter(Liste L) void _visualiser_rec(Liste L, int compteur) { if (L != NULL) { - /* FIXME: suboptimal printing to stdout, put this code path outside the recursion */ - if (compteur == 0) - printf("--Debut--\n"); printf("L[%d]->value=%d\n", compteur, L->valeur); compteur++; _visualiser_rec(L->suivant, compteur); - if (compteur == (longueur_rec(L) - 1)) - printf("--Fin--\n"); } } @@ -96,7 +91,9 @@ void visualiser_rec(Liste L) { int compteur = 0; + printf("--Debut--\n"); _visualiser_rec(L, compteur); + printf("--Fin--\n"); } bool rechercher_iter(element e, Liste L) -- 2.34.1