From ad26efb454c631bcd404bd131201cf79ebaf96c9 Mon Sep 17 00:00:00 2001 From: hugogogo Date: Mon, 27 Sep 2021 17:04:07 +0200 Subject: [PATCH] check doubles before ordered --- srcs/push_swap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcs/push_swap.c b/srcs/push_swap.c index a328fb3..2207196 100644 --- a/srcs/push_swap.c +++ b/srcs/push_swap.c @@ -38,10 +38,10 @@ int check_valid(t_stack *list) { if (!list) return (0); - if (is_ordered(list) == 1) - return (0); if (has_doubles(list) == 1) ps_stop(NULL, (t_list *)list, 3); + if (is_ordered(list) == 1) + return (0); return (1); }