From 2e79b4ac22321abd69c7f1a9748b5761abaab1ec Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 22 Jan 2020 10:48:21 +0100 Subject: Added micro optimisation when sorting frame == 2 and less reverse rotate when frame == full stack, norming --- src/common/action.c | 72 ----------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 src/common/action.c (limited to 'src/common/action.c') diff --git a/src/common/action.c b/src/common/action.c deleted file mode 100644 index c095e59..0000000 --- a/src/common/action.c +++ /dev/null @@ -1,72 +0,0 @@ -#include "common.h" - -void swap_a(t_stack *a) -{ - stack_swap(a); -} - -void swap_b(t_stack *b) -{ - stack_swap(b); -} - -void swap_both(t_stack *a, t_stack *b) -{ - swap_a(a); - swap_b(b); -} - -void push_a(t_stack *a, t_stack *b) -{ - int tmp; - - if (stack_empty(b)) - return ; - tmp = stack_peek(b); - stack_pop(b); - stack_push(a, tmp); -} - -void push_b(t_stack *b, t_stack *a) -{ - int tmp; - - if (stack_empty(a)) - return ; - tmp = stack_peek(a); - stack_pop(a); - stack_push(b, tmp); - -} - -void rotate_a(t_stack *a) -{ - stack_rotate(a); -} - -void rotate_b(t_stack *b) -{ - stack_rotate(b); -} - -void rotate_both(t_stack *a, t_stack *b) -{ - rotate_a(a); - rotate_b(b); -} - -void reverse_rotate_a(t_stack *a) -{ - stack_reverse_rotate(a); -} - -void reverse_rotate_b(t_stack *b) -{ - stack_reverse_rotate(b); -} - -void reverse_rotate_both(t_stack *a, t_stack *b) -{ - reverse_rotate_a(a); - reverse_rotate_b(b); -} -- cgit