From 43c3b4149894bb5c2a2579bf2b989dec480e2e38 Mon Sep 17 00:00:00 2001 From: Abreu Date: Sat, 11 Sep 2021 18:57:16 -0300 Subject: [PATCH] Nitpicking --- 2020/01/balance.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/2020/01/balance.c b/2020/01/balance.c index c91bef5..2fb75d3 100644 --- a/2020/01/balance.c +++ b/2020/01/balance.c @@ -44,13 +44,13 @@ void sortLine(Barrel * line) { int loadBarrel (Barrel * reservoir, Barrel b) { float capacity = b.juice + b.alcohol; - if (reservoir->juice - capacity * 0.86 >= -EPSILON - && reservoir->alcohol - capacity * 0.14 >= -EPSILON) { - reservoir->juice -= capacity * 0.86; - reservoir->alcohol -= capacity * 0.14; - return b.no; - } + if (reservoir->juice - capacity * 0.86 < -EPSILON + || reservoir->alcohol - capacity * 0.14 < -EPSILON) return 0; + + reservoir->juice -= capacity * 0.86; + reservoir->alcohol -= capacity * 0.14; + return b.no; } int balance() {