Re: [PATCH 1/3] tree.c: update read_tree_recursive callback to pass strbuf as base
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Dec 2, 2014, 12:11 UTC
- Message-ID
- <CACsJy8B7G9xQerZ+6GTPQuG2v1DuJLXfsKFobuz_vyFahnXuYQ@mail.gmail.com>
- In-Reply-To
- <xmqqk32bp3nk.fsf@gitster.dls.corp.google.com>
On Tue, Dec 2, 2014 at 2:32 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes: > >> This allows the callback to use 'base' as a temporary buffer to >> quickly assemble full path "without" extra allocation. The callback >> has to restore it afterwards of course. > > Hmph, what's the quote around 'without' doing there?
because it's only true if you haven't used up all preallocated space in strbuf. If someone passes an empty strbuf, then underneath strbuf may do a few realloc until the buffer is large enough.
-- Duy