]> git.ipfire.org Git - thirdparty/git.git/commit
streaming.c: move {open,close,read} from vtable to "struct git_istream"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 5 May 2021 12:33:32 +0000 (14:33 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 May 2021 03:56:10 +0000 (12:56 +0900)
commitd4e2d15a8b028352df480e7be9f1864f59c16299
treee8cd1e8403141fb2cc54896f59c23a413285b324
parentde94c0eace41c9d93f6c2c97e98797afabb5932e
streaming.c: move {open,close,read} from vtable to "struct git_istream"

Move the definition of the structure around the open/close/read
functions introduced in 46bf043807c (streaming: a new API to read from
the object store, 2011-05-11) to instead populate "close" and "read"
members in the "struct git_istream".

This gets us rid of an extra pointer deference, and I think makes more
sense. The "close" and "read" functions are the primary interface to
the stream itself.

Let's also populate a "open" callback in the same struct. That's now
used by open_istream() after istream_source() decides what "open"
function should be used. This isn't needed to get rid of the
"stream_vtbl" variables, but makes sense for consistency.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
streaming.c