Thread (88 messages) 88 messages, 6 authors, 2021-09-08

Re: [PATCH v4 05/10] unpack-trees: fix nested sparse-dir search

flat view

From: Derrick Stolee <hidden>
Date: 2021-08-25 01:09:30

On 8/24/2021 6:21 PM, René Scharfe wrote:
Am 24.08.21 um 23:51 schrieb Derrick Stolee via GitGitGadget:
quoted
-	struct cache_entry *ce;
+	const char *path;
+	struct cache_entry *ce = NULL;
                              ^^^^^^^
This added initialization doesn't seem to be needed...
quoted
 	int pos = find_cache_pos(info, p->path, p->pathlen);
 	struct unpack_trees_options *o = info->data;
@@ -1283,7 +1284,9 @@ static struct cache_entry *find_cache_entry(struct traverse_info *info,
 	while (pos >= 0) {
 		ce = o->src_index->cache[pos];
... because ce is set here before it's used.
Better yet, 'ce' is only used within the while loop, so its
declaration can be moved to this line instead.

Thanks,
-Stolee
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help