[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH v6 6/7] git-reflog: add create and exists functions
From:       Junio C Hamano <gitster () pobox ! com>
Date:       2015-06-30 21:28:05
Message-ID: xmqqy4j0c2e2.fsf () gitster ! dls ! corp ! google ! com
[Download RAW message or body]

David Turner <dturner@twopensource.com> writes:

> On Tue, 2015-06-30 at 12:48 -0700, Junio C Hamano wrote:
>> Eric Sunshine <sunshine@sunshineco.com> writes:
>> 
>> >>> Alternatives would be strbuf_reset() or declaring and releasing the
>> >>> strbuf within the for-loop scope.
>> >>
>> >> Because _reset() just rewinds the .len pointer without deallocating,
>> >> you would need an extra _release() before it goes out of scope. If
>> >> it is expected that the strbuf will be reused for a number of times,
>> >> the length of the string each iteration uses is similar, and you
>> >> will iterate the loop many times, "_reset() each time and _release()
>> >> to clean-up" pattern would save many calls to realloc/free.
>> >
>> > Yep, that's why I suggested strbuf_reset() as an alternative (and
>> > likely would have chosen it myself).
>> 
>> OK, then let's do that by squashing this in.
>> 
>>  builtin/reflog.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> I squashed that into my repo on github:

I'm already deep into today's integration cycle, so it is unlikely
I'd pull that before I push the result out.  Please let me know if
the resulting tree looks wrong (I only queued it to be squashed,
haven't done the squashing two into one yet).

Thanks.  The 7-patch series with this fixup looks good to me.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic