]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/merged: refactor seeking of records
authorPatrick Steinhardt <ps@pks.im>
Tue, 6 Feb 2024 06:35:50 +0000 (07:35 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Feb 2024 20:10:08 +0000 (12:10 -0800)
commit59f302ca5abf3e8ec4f14f098b26adf786017fad
tree457575021305e0b755f5999a2f04a6d8fb5285b9
parent81879123c32d06406de5bfaf68baf6029660ca2a
reftable/merged: refactor seeking of records

The code to seek reftable records in the merged table code is quite hard
to read and does not conform to our coding style in multiple ways:

  - We have multiple exit paths where we release resources even though
    that is not really necessary.

  - We use a scoped error variable `e` which is hard to reason about.
    This variable is not required at all.

  - We allocate memory in the variable declarations, which is easy to
    miss.

Refactor the function so that it becomes more maintainable in the
future.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/merged.c