Skip to content

Commit 6a90778

Browse files
stefanbellergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9ae54a1 commit 6a90778

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

streaming.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ struct git_istream *open_istream(const unsigned char *sha1,
149149
return NULL;
150150
}
151151
}
152-
if (st && filter) {
152+
if (filter) {
153153
/* Add "&& !is_null_stream_filter(filter)" for performance */
154154
struct git_istream *nst = attach_stream_filter(st, filter);
155155
if (!nst)

0 commit comments

Comments
 (0)