long if condition?
if(strcmp(optional_args_list[optional_index].flag, argv_copy[index])==0||strcmp(optional_args_list[optional_index].extended, argv_copy[index])==0)
Store the results of the functions in variables and use them...¿
this is not long
It's just two string comparisons in or
Create a function
Add spaces around the operators, maybe put a newline after the Boolean operators. Or make some temporary variables for the things you're comparing rather than getting a field from a struct from an array.
struct ??? opt_arg = optional_args_list[optional_index]; const char *arg_copy = argv_copy[index]; if(strcmp(opt_arg.flag, arg_copy) == 0 || strcmp(opt_arg.extended, arg_copy) == 0)
it feels more describtive this way , I like it as it is tbqh
Обсуждают сегодня