Thread (222 messages) 222 messages, 11 authors, 2020-04-06

Re: [PATCH v5 10/15] bugreport: add config values from safelist

From: Martin Ågren <hidden>
Date: 2020-01-31 21:25:20

On Fri, 24 Jan 2020 at 04:40, [off-list ref] wrote:
Taking the build-time generated array and putting it into a set saves us
time - since git_config_bugreport() is called for every option the user
has configured, performing option lookup in constant time is a useful
optimization.
I'm sympathetic to your sending out what you have to obtain comments,
knowing that it's not perfect. It would have saved me some time and
effort if I'd known that this was the case though. An "[RFC]" tag,
perhaps. Or at least tweaking the above part of this commit message to
say that this might be over-engineered, with a reference to [1].

[1] https://lore.kernel.org/git/20200124032905.GA37541@google.com/ (local)
+       int safelist_len = sizeof(bugreport_config_safelist) / sizeof(const char *);
I was going to suggest ARRAY_SIZE, but then I realized there are some
outstanding questions around whether you need this stuff in the first
place. I'd be inclined to guess that the first version of this would be
"for each safelisted item, obtain it and include", ignoring any "a.*.b"
business. In which case you wouldn't really need this hashset stuff.


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