Skip to content

Commit

Permalink
rename repeat_dual_stack_operations
Browse files Browse the repository at this point in the history
  • Loading branch information
rask24 committed Apr 20, 2024
1 parent 8c6d01e commit a8e4768
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ SRC = $(SRC_DIR)/main.c \
$(SRC_DIR)/stack_operations/rotate.c \
$(SRC_DIR)/stack_operations/reverse_rotate.c \
$(SRC_DIR)/stack_operations/repeat_stack_operations.c \
$(SRC_DIR)/stack_operations/do_double_n_operations.c \
$(SRC_DIR)/stack_operations/repeat_dual_stack_operations.c \
$(SRC_DIR)/utils/get_first_index.c \
$(SRC_DIR)/utils/get_second_index.c \
$(SRC_DIR)/utils/get_third_index.c \
Expand Down
4 changes: 2 additions & 2 deletions include/stack_operations.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/11 12:41:01 by reasuke #+# #+# */
/* Updated: 2024/04/20 15:24:23 by reasuke ### ########.fr */
/* Updated: 2024/04/20 15:25:05 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -22,7 +22,7 @@ void reverse_rotate_stack(t_stack **p_stack);

void repeat_stack_operations(t_stack **p_st, int n,
void (*operation)(t_stack **));
void do_double_n_operations(t_stack **p_a, t_stack **p_b, int n,
void repeat_dual_stack_operations(t_stack **p_a, t_stack **p_b, int n,
void (*operation)(t_stack **, t_stack **));

void operate_sa(t_stack **p_a);
Expand Down
6 changes: 3 additions & 3 deletions src/sort/large_sort/greedy_operation.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/10 10:43:16 by reasuke #+# #+# */
/* Updated: 2024/04/20 15:21:20 by reasuke ### ########.fr */
/* Updated: 2024/04/20 15:30:34 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -37,15 +37,15 @@ static void _do_alined_operation(t_stack **p_a, t_stack **p_b,
ir_abs = ft_abs(get_content(opt_st_b)->rra_cost);
if (get_content(opt_st_b)->opt_method == RA_RB)
{
do_double_n_operations(p_a, p_b, ft_min(sf_abs, if_abs), operate_rr);
repeat_dual_stack_operations(p_a, p_b, ft_min(sf_abs, if_abs), operate_rr);
if (sf_abs > if_abs)
repeat_stack_operations(p_b, sf_abs - if_abs, operate_rb);
else if (sf_abs < if_abs)
repeat_stack_operations(p_a, if_abs - sf_abs, operate_ra);
}
if (get_content(opt_st_b)->opt_method == RRA_RRB)
{
do_double_n_operations(p_a, p_b, ft_min(sr_abs, ir_abs), operate_rrr);
repeat_dual_stack_operations(p_a, p_b, ft_min(sr_abs, ir_abs), operate_rrr);
if (sr_abs > ir_abs)
repeat_stack_operations(p_b, sr_abs - ir_abs, operate_rrb);
else if (sr_abs < ir_abs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* do_double_n_operations.c :+: :+: :+: */
/* repeat_dual_stack_operations.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/10 19:22:50 by reasuke #+# #+# */
/* Updated: 2024/04/20 15:15:59 by reasuke ### ########.fr */
/* Updated: 2024/04/20 15:25:42 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "stack_operations.h"

void do_double_n_operations(t_stack **p_a, t_stack **p_b, int n,
void repeat_dual_stack_operations(t_stack **p_a, t_stack **p_b, int n,
void (*operation)(t_stack **, t_stack **))
{
while (n--)
Expand Down
2 changes: 1 addition & 1 deletion src/stack_operations/repeat_stack_operations.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/10 19:22:26 by reasuke #+# #+# */
/* Updated: 2024/04/20 15:25:50 by reasuke ### ########.fr */
/* Updated: 2024/04/20 15:32:16 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down

0 comments on commit a8e4768

Please sign in to comment.