Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15

Re: [PATCH v2] optimize path_relative()

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:55

Clemens Buchacher [off-list ref] writes:
Avoid copying to strbuf in case a subset of the original string can
be returned.

Since the strbuf is no longer guaranteed to be updated, this
function is different from quote_path_relative(). To avoid
confusion, do not export it.

Signed-off-by: Clemens Buchacher <redacted>
The version of path_relative() after this patch looks much easier to
follow.

I noticed that there is a similar function write_name_quotedpfx() defined
in the same file, and wondered if we can do something similar to avoid the
whole allocation business.  But that would only be a microoptimize useful
for write_name_quoted_relative() and not for quote_path_relative() that
has a lot more callers, so it would probably not be worth it.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help