Skip to content

Commit

Permalink
modify sort argument
Browse files Browse the repository at this point in the history
  • Loading branch information
rask24 committed Jan 16, 2024
1 parent eef5dd3 commit da3e994
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/10 12:37:36 by reasuke #+# #+# */
/* Updated: 2024/01/15 16:59:58 by reasuke ### ########.fr */
/* Updated: 2024/01/16 13:13:30 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -39,7 +39,7 @@ int main(int argc, char **argv)
check_args(argc, argv);
stack_a = generate_stack(argc, argv);
stack_b = NULL;
sort(&stack_a, &stack_b, argc);
sort(&stack_a, &stack_b, argc - 1);
ft_lstclear(&stack_a, free);
return (0);
}
7 changes: 2 additions & 5 deletions src/sort/sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/15 15:10:35 by reasuke #+# #+# */
/* Updated: 2024/01/15 16:31:27 by reasuke ### ########.fr */
/* Updated: 2024/01/16 13:13:45 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"

void sort(t_list **stack_a, t_list **stack_b, int argc)
void sort(t_list **stack_a, t_list **stack_b, int num_of_element)
{
int num_of_element;

num_of_element = argc - 1;
if (num_of_element <= 3)
nano_sort(stack_a, num_of_element);
else if (num_of_element == 4)
Expand Down

0 comments on commit da3e994

Please sign in to comment.