summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Beller <stefanbeller@googlemail.com>2013-07-23 13:16:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-23 18:35:18 (GMT)
commit6a907786af835ac15962be53f1492f23e044f479 (patch)
tree587c4f9f125dfa1c5bd2dcacba089d3a22755c62
parent9ae54a1ddebbbc8f3f12116f3ad9fd6dcf74bf02 (diff)
downloadgit-6a907786af835ac15962be53f1492f23e044f479.zip
git-6a907786af835ac15962be53f1492f23e044f479.tar.gz
git-6a907786af835ac15962be53f1492f23e044f479.tar.bz2
open_istream: remove unneeded check for null pointer
'st' is allocated via xmalloc a few lines before and passed to the stream opening functions. The xmalloc function is written in a way that either 'st' is allocated valid memory or xmalloc already dies. The function calls to open_istream_* do not change 'st', as the pointer is passed by reference and not a pointer of a pointer. Hence 'st' cannot be null at that part of the code. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--streaming.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/streaming.c b/streaming.c
index cac282f..efbc3ba 100644
--- a/streaming.c
+++ b/streaming.c
@@ -149,7 +149,7 @@ struct git_istream *open_istream(const unsigned char *sha1,
return NULL;
}
}
- if (st && filter) {
+ if (filter) {
/* Add "&& !is_null_stream_filter(filter)" for performance */
struct git_istream *nst = attach_stream_filter(st, filter);
if (!nst)