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