Skip to content

Commit

Permalink
improving sort if target is at middle
Browse files Browse the repository at this point in the history
  • Loading branch information
biralavor committed Jul 1, 2024
1 parent bdd4eb8 commit 534e50e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions program_to_test/src/ft_sort_until4.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: umeneses <umeneses@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/10 12:41:29 by umeneses #+# #+# */
/* Updated: 2024/07/01 12:46:21 by umeneses ### ########.fr */
/* Updated: 2024/07/01 18:20:54 by umeneses ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -46,7 +46,7 @@ void ft_push_b_all_but_three(t_stack **stack_a, t_stack **stack_b)
while ((stack_size > 6) && (index < stack_size)
&& (pushed < stack_size / 2))
{
if ((*stack_a)->final_pos <= (stack_size / 2))
if ((*stack_a)->final_pos < (stack_size / 2))
{
ft_do_push_b(stack_a, stack_b);
pushed++;
Expand Down

0 comments on commit 534e50e

Please sign in to comment.