From: Stefan Beller Date: Fri, 26 Jun 2015 19:40:19 +0000 (-0700) Subject: revision.c: remove unneeded check for NULL X-Git-Tag: v2.5.0-rc3~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae40ebda9bf68b0be8deafd93b7982d443f2b1b2;p=thirdparty%2Fgit.git revision.c: remove unneeded check for NULL 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 Acked-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/revision.c b/revision.c index 06f31d6fb5..e04bd3dffe 100644 --- a/revision.c +++ b/revision.c @@ -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;