Skip to content

Commit

Permalink
revision.c: remove unneeded check for NULL
Browse files Browse the repository at this point in the history
The function is called only from one place, which makes sure to have
`interesting_cache` not NULL.  Additionally the variable is a
dereferenced a few lines before unconditionally, which would have
resulted in a segmentation fault before hitting this check.

Signed-off-by: Stefan Beller <sbeller@google.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Stefan Beller authored and Junio C Hamano committed Jun 29, 2015
1 parent b6e8a3b commit ae40ebd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ static int everybody_uninteresting(struct commit_list *orig,
list = list->next;
if (commit->object.flags & UNINTERESTING)
continue;
if (interesting_cache)
*interesting_cache = commit;

*interesting_cache = commit;
return 0;
}
return 1;
Expand Down

0 comments on commit ae40ebd

Please sign in to comment.