delete condition to add operation in t_stacks

This commit is contained in:
2026-01-08 13:59:09 +00:00
parent 2ba9029955
commit bb39e7d0ec
4 changed files with 26 additions and 48 deletions

View File

@@ -6,7 +6,7 @@
/* By: mteriier <mteriier@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/12/08 14:48:44 by mteriier #+# #+# */
/* Updated: 2026/01/08 13:53:40 by dgaillet ### ########lyon.fr */
/* Updated: 2026/01/08 13:58:13 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
@@ -24,10 +24,8 @@ void sa(t_stacks *stacks)
stock = a->value;
a->value = a->next->value;
a->next->value = stock;
if (stacks->bench)
stacks->sa++;
else
write(1, "sa\n", 3);
stacks->sa++;
write(1, "sa\n", 3);
}
void sb(t_stacks *stacks)
@@ -41,10 +39,8 @@ void sb(t_stacks *stacks)
stock = b->value;
b->value = b->next->value;
b->next->value = stock;
if (stacks->bench)
stacks->sb++;
else
write(1, "sb\n", 3);
stacks->sb++;
write(1, "sb\n", 3);
}
void ss(t_stacks *stacks)
@@ -69,8 +65,6 @@ void ss(t_stacks *stacks)
a->value = a->next->value;
a->next->value = stock;
}
if (stacks->bench)
stacks->ss++;
else
write(1, "ss\n", 3);
stacks->ss++;
write(1, "ss\n", 3);
}