revision.c: remove unneeded check for NULL
authorStefan Beller <sbeller@google.com>
Fri, 26 Jun 2015 19:40:19 +0000 (12:40 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Jun 2015 16:54:18 +0000 (09:54 -0700)
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>
revision.c
index 06f31d6fb5632c6d89f581f8d9282348cb6f743a..e04bd3dffeb85d8c41ea2c8adc21b48385c19172 100644 (file)
@@ -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;