carp icon indicating copy to clipboard operation
carp copied to clipboard

A redundant asserts

Open janus opened this issue 9 years ago • 1 comments

Just noticed that assert macro was used twice on the same argument without change of state, any reason for this? Could be found inside carp_reg_inc and carp_reg_dec (https://github.com/tekknolagi/carp/blob/master/src/carp_registers.c#L89):

carp_bool carp_reg_inc (carp_value regs[], carp_reg reg) {
  assert(regs != NULL);

  assert(regs != NULL);

janus avatar May 03 '15 13:05 janus

@janus thank you for making an issue! That is indeed a typo. I am very slowly re-writing Carp, so I will not fix this immediately — but you should feel free to make a pull request if you like.

tekknolagi avatar May 03 '15 17:05 tekknolagi