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:
de32237
)
exo1: swap, no need to declare tmp variable if values are the same
author
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Sun, 12 Feb 2017 19:32:02 +0000
(20:32 +0100)
committer
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Sun, 12 Feb 2017 19:32:02 +0000
(20:32 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
exo1/exo1.c
patch
|
blob
|
blame
|
history
diff --git
a/exo1/exo1.c
b/exo1/exo1.c
index 11fc1fb3cf72e7a0756f5a69a558296bb1aec6b7..822d73ff169a2fe9b8985e4a9eb58b3f93fe1f02 100644
(file)
--- a/
exo1/exo1.c
+++ b/
exo1/exo1.c
@@
-16,8
+16,8
@@
void xorSwap (int *v1, int *v2) {
}
void swap(int* v1, int* v2) {
- int tmp = *v1;
if (v1 != v2) {
+ int tmp = *v1;
*v1 = *v2;
*v2 = tmp;
}