From f7b599fe6f00c554e8f77411cc083718ff52db8b Mon Sep 17 00:00:00 2001 From: Scoopta Date: Tue, 25 Feb 2020 00:13:12 -0800 Subject: [PATCH] Added utils_max(). utils_min() is now a one liner. --- src/utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils.c b/src/utils.c index 13adb57..64eff1f 100644 --- a/src/utils.c +++ b/src/utils.c @@ -49,11 +49,11 @@ char* utils_concat(size_t arg_count, ...) { } size_t utils_min(size_t n1, size_t n2) { - if(n1 < n2) { - return n1; - } else { - return n2; - } + return n1 < n2 ? n1 : n2; +} + +size_t utils_max(size_t n1, size_t n2) { + return n1 > n2 ? n1 : n2; } size_t utils_min3(size_t n1, size_t n2, size_t n3) {