[PATCH] unpack-trees: improve maintainability
From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:36
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:36
Subsystem:
the rest · Maintainer:
Linus Torvalds
Clarify that ce can be NULL by adding a check (probably more efficient also), and get rid of unnecessary indentation (since it's a single line it doesn't matter, but in the future it might). Signed-off-by: Felipe Contreras <redacted> --- unpack-trees.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/unpack-trees.c b/unpack-trees.c
index 57b4074..9c0100d 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c@@ -605,8 +605,9 @@ static int unpack_nondirectories(int n, unsigned long mask, o); for (i = 0; i < n; i++) { struct cache_entry *ce = src[i + o->merge]; - if (ce != o->df_conflict_entry) - free(ce); + if (!ce || ce == o->df_conflict_entry) + continue; + free(ce); } return rc; }
--
1.8.3.698.g079b096