]> git.ipfire.org Git - thirdparty/git.git/commit - grep.c
grep: extract grep_binexp() from grep_or_expr()
authorTaylor Blau <me@ttaylorr.com>
Thu, 6 Jan 2022 19:50:12 +0000 (14:50 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Jan 2022 21:14:55 +0000 (13:14 -0800)
commitf2d275984d2b931b51f39d4019e78031a36cb2f0
tree202aaf8fc8b07516953472ba588eb8fa33ae1c4b
parente2b154277addad0a70b23d03c9156ac8e08c4a82
grep: extract grep_binexp() from grep_or_expr()

When constructing an OR node, the grep.c code uses `grep_or_expr()` to
make a node, assign its kind, and set its left and right children. The
same is not done for AND nodes.

Prepare to introduce a new `grep_and_expr()` function which will share
code with the existing implementation of `grep_or_expr()` by introducing
a new function which compiles either kind of binary expression, and
reimplement `grep_or_expr()` in terms of it.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
grep.c