refs: factor out set_read_ref_cutoffs()
authorDenton Liu <redacted>
Wed, 6 Jan 2021 09:01:53 +0000 (01:01 -0800)
committerJunio C Hamano <redacted>
Sun, 10 Jan 2021 20:24:00 +0000 (12:24 -0800)
commit95c2a71820c8fc2bd333921dee71c35871923716
tree92e2161980ec3102dcb3ad2943f7d65393498521
parent71ca53e8125e36efbda17293c50027d31681a41f
refs: factor out set_read_ref_cutoffs()

This block of code is duplicated twice. In a future commit, it will be
duplicated for a third time. Factor out the common functionality into
set_read_ref_cutoffs().

In the case of read_ref_at_ent(), we are incrementing `cb->reccnt` at the
beginning of the function. Move these to right before the return so that
the `cb->reccnt - 1` is changed to `cb->reccnt` and it can be cleanly
factored out into set_read_ref_cutoffs(). The duplication of the
increment statements will be removed in a future patch.

Signed-off-by: Denton Liu <redacted>
Signed-off-by: Junio C Hamano <redacted>
refs.c
git clone https://git.99rst.org/PROJECT