]> git.ipfire.org Git - thirdparty/git.git/commit
parse-options: set arg of abbreviated option lazily
authorRené Scharfe <l.s.r@web.de>
Sun, 3 Mar 2024 12:19:39 +0000 (13:19 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 3 Mar 2024 17:49:21 +0000 (09:49 -0800)
commit597f9d037df56334b9dc938ffcfeb9a879f80a7c
tree87b7701ba73fc322ab4af0f70e0caa913dc72dfe
parent289cb15541874e5c1599fee2e145a7af39085069
parse-options: set arg of abbreviated option lazily

Postpone setting the opt pointer until we're about to call get_value(),
which uses it.  There's no point in setting it eagerly for every
abbreviated candidate option, which may turn out to be ambiguous.
Removing this assignment from the loop doesn't noticeably improve the
performance, but allows further simplification.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.c