]> git.ipfire.org Git - thirdparty/git.git/commit
combine-diff: drop public declaration of combine_diff_path_size()
authorJeff King <peff@peff.net>
Thu, 9 Jan 2025 08:50:19 +0000 (03:50 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Jan 2025 20:24:26 +0000 (12:24 -0800)
commit69f6dea44cf272dc80be6dffd0ac8db5c50585b4
tree940b1f7fac4a844b51faf6e27b2cee828647fcd4
parentb20d7d348c4d32777cd577c221de529452baca03
combine-diff: drop public declaration of combine_diff_path_size()

We want callers to use combine_diff_path_new() to allocate structs,
rather than using combine_diff_path_size() and xmalloc(). That gives us
more consistency over the initialization of the fields.

Now that the final external user of combine_diff_path_size() is gone, we
can stop declaring it publicly. And since our constructor is the only
caller, we can just inline it there.

Breaking the size computation into two parts also lets us reuse the
intermediate multiplication result of the parent length, since we need
to know it to perform our memset(). The result is a little easier to
read.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
combine-diff.c
diff.h