diffcore-rename: simplify limit check
commitad8a1be529ea9e0bd6346a3cb1d53fec16e3bd10
authorElijah Newren <newren@gmail.com>
Fri, 11 Dec 2020 09:08:42 +0000 (11 09:08 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Dec 2020 17:34:50 +0000 (14 09:34 -0800)
tree06291a5270d788d5d80b6939ad932cb5e35d7ea3
parent00b8cccdd83c6f8c9ffefd133b291dadf8e788d7
diffcore-rename: simplify limit check

diffcore-rename had two different checks of the form

    if ((a < limit || b < limit) &&
        a * b <= limit * limit)

This can be simplified to

    if (st_mult(a, b) <= st_mult(limit, limit))

which makes it clearer how we are checking for overflow, and makes it
much easier to parse given the drop from 8 to 4 variable appearances.

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