mirror of
https://github.com/git/git.git
synced 2024-11-23 18:05:29 +08:00
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>
This commit is contained in:
parent
9ae54a1dde
commit
6a907786af
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user