Thread (20 messages) 20 messages, 3 authors, 2023-06-27

Re: [PATCH 3/5] replace strbuf_expand_dict_cb() with strbuf_expand_step()

From: Jeff King <hidden>
Date: 2023-06-27 08:31:22

On Sat, Jun 17, 2023 at 10:42:26PM +0200, René Scharfe wrote:
Avoid the overhead of setting up a dictionary and passing it via
strbuf_expand() to strbuf_expand_dict_cb() by using strbuf_expand_step()
in a loop instead.  It requires explicit handling of %% and unrecognized
placeholders, but is more direct and simpler overall, and expands only
on demand.
Great. I think even replacing the dictionary with regular
strbuf_expand() would be an improvement in terms of the on-demand
loading. But I am happy to see it go all the way to the iterative
version. :)

Your comment above does make me wonder if strbuf_expand_step() should be
quietly handling "%%" itself. But I guess strbuf_expand() doesn't, and
your branch.c quote-literal example probably would not want that
behavior.

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