repositories
/
TD_C.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f585930
)
TP 11 exo2: avoid a function run at each for() loop iteration
author
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Wed, 8 Mar 2017 14:00:11 +0000
(15:00 +0100)
committer
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Wed, 8 Mar 2017 14:00:11 +0000
(15:00 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
TP_11/exo2/ui.c
patch
|
blob
|
blame
|
history
diff --git
a/TP_11/exo2/ui.c
b/TP_11/exo2/ui.c
index 7599780b4a88f37ade741213b249de17eca19ba0..b8233b55175a5746e5f5e876db486c9e41f8d5e5 100644
(file)
--- a/
TP_11/exo2/ui.c
+++ b/
TP_11/exo2/ui.c
@@
-18,7
+18,7
@@
void displayArray(const int array[], unsigned length) {
void displayList(link_t* head) {
printf("--Begin--\n");
- for (unsigned i = 0
; i < list_count(head)
; i++) {
+ for (unsigned i = 0
, length = list_count(head); i < length
; i++) {
printf("value at [%d]=%d\n", i, list_get(head, i));
}
printf("--End--\n");