minishell icon indicating copy to clipboard operation
minishell copied to clipboard

[REFACTOR] Split up `exec_pipeline()` for readability

Open itislu opened this issue 1 year ago • 0 comments

The function was very dense and we resorted to bad practices like the comma operator to keep the function length within 25 lines for Norminette.

  • Split up long else block of exec_pipeline() into separate exec_cmd_table() function and rename the original function to iter_pipeline().
  • Change unnecessary long while (check cmd_table_type) loop check to while (true) + if (check cmd_table_type) + break.
  • Remove comma operator.

itislu avatar Jul 04 '24 07:07 itislu