From 2d35ab91db8972e9bf1624251fdabe4f7570a8e9 Mon Sep 17 00:00:00 2001 From: rask24 Date: Sat, 10 Feb 2024 00:04:41 +0900 Subject: [PATCH] fix build for gcc --- src/sort/set_opt_method.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/sort/set_opt_method.c b/src/sort/set_opt_method.c index 5c6e466..105b180 100644 --- a/src/sort/set_opt_method.c +++ b/src/sort/set_opt_method.c @@ -6,7 +6,7 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/09 10:23:28 by reasuke #+# #+# */ -/* Updated: 2024/02/09 23:40:17 by reasuke ### ########.fr */ +/* Updated: 2024/02/10 00:03:36 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ @@ -78,6 +78,7 @@ static void _set_is_opt(t_stack **p_b) i = 0; st_b = *p_b; opt_cost = INT_MAX; + min_index = -1; while (i < size_b) { if (ft_chmin(&opt_cost, get_content(st_b)->min_cost)) @@ -87,11 +88,8 @@ static void _set_is_opt(t_stack **p_b) } i = 0; st_b = *p_b; - while (i < min_index) - { + while (i++ < min_index) st_b = st_b->next; - i++; - } get_content(st_b)->is_opt = true; }