Re: [PATCH v1 3/5] list-objects-filter: implement composite filters
- From
Jeff King <peff@peff.net>
- Date
- Jun 9, 2019, 12:36 UTC
- Message-ID
- <20190609123636.GA23555@sigill.intra.peff.net>
- In-Reply-To
- <20190604234951.GB43275@comcast.net>
On Tue, Jun 04, 2019 at 04:49:51PM -0700, Matthew DeVore wrote:
Show 13 quoted lines
> I tried to do it anyway :) I think this makes the strbuf API a bit easier to > reason about, and strbuf.h is a bit more self-documenting. WDYT? > > [...] > > +typedef int (*char_predicate)(char ch); > + > +int is_rfc3986_unreserved(char ch); > +int is_rfc3986_reserved_or_unreserved(char ch); > + > void strbuf_addstr_urlencode(struct strbuf *sb, const char *name, > - int reserved); > + char_predicate allow_unencoded_fn);
Yeah, that seems reasonable. I worry slightly about adding function-call overhead to something that's processing a string character-by-character, but these strings tend to be short and infrequent.
-Peff