[PATCH] unpack-trees: improve maintainability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <felipe.contreras@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]