]> git.ipfire.org Git - thirdparty/git.git/commit - ref-filter.c
ref-filter: strip format option after a field name only once while parsing
authorSZEDER Gábor <szeder@ira.uka.de>
Sun, 2 Oct 2016 16:35:11 +0000 (18:35 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Oct 2016 19:47:19 +0000 (12:47 -0700)
commite94ce1394e17e1b91b943b8d41131b6aadb96b88
tree3da28b721871bc4b5e985c87cf4a26e2ffca9750
parent92d426662b0673adcd41995e6c2f0afcb9ad39af
ref-filter: strip format option after a field name only once while parsing

When parse_ref_filter_atom() iterates over a list of valid atoms to
check that a field name is one of them, it has to strip the optional
colon-separated format option suffix that might follow the field name.
However, it does so inside the loop, i.e. it performs the exact same
stripping over and over again.

Move stripping the format option suffix out of that loop, so it's only
performed once for each parsed field name.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ref-filter.c