merge-recursive: remove unnecessary oid_eq function
commit763a59e71cee1542665e640f63141a0bf89e6381
authorElijah Newren <newren@gmail.com>
Wed, 1 Jan 2020 05:20:57 +0000 (1 05:20 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Jan 2020 18:35:24 +0000 (2 10:35 -0800)
tree4aa7af9039500c16db89abe5326bb25c1a969e8a
parent53a06cf39b756eddfe4a2a34da93e3d04eb7b728
merge-recursive: remove unnecessary oid_eq function

Back when merge-recursive was first introduced in commit 6d297f8137
(Status update on merge-recursive in C, 2006-07-08), it created a
sha_eq() function.  This function pre-dated the introduction of
hashcmp() to cache.h by about a month, but was switched over to using
hashcmp() as part of commit 9047ebbc22 (Split out merge_recursive() to
merge-recursive.c, 2008-08-12).  In commit b4da9d62f9 (merge-recursive:
convert leaf functions to use struct object_id, 2016-06-24), sha_eq() was
renamed to oid_eq() and its hashcmp() call was switched to oideq().

oid_eq() is basically just a wrapper around oideq() that has some extra
checks to protect against NULL arguments or to allow short-circuiting if
one of the arguments is NULL.  I don't know if any caller ever tried to
call with NULL arguments, but certainly none do now which means the
extra checks serve no purpose.  (Also, if these checks were genuinely
useful, then they probably should be added to the main oideq() so all
callers could benefit from them.)

Reduce the cognitive overhead of having both oid_eq() and oideq(), by
getting rid of merge-recursive's special oid_eq() wrapper.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c