> Heyho Roberto,
>
> usually the compiler should fix this code duplication, at most with -Os set.
> So, before the pull request, the code is easier to read and the compiler takes care of
> code deduplication. After the pull request you save some compiler optimization time
I don't think compiler can optimize this situation. Take a look to the
original code:
die("....", strerror(errno));
case -1:
die("....", strerror(errno));
Compiler doesn't know that die will not return (with c11 you can
signal it with _Noreturn, but it is not this case), so it thinks
that there are two consecutive calls to die.
> versus a little longer parsing time due to a few less lines of
> code which are also more intuitive. I think we're better off
> without this one.
I already said in my previous mail that I am used to it, and for
me fallthroughs are not difficult to read, and they are very
idiomatic. Remember that readability depend of the eyes which read
;). But I have learnt something with proprietary code, if some
pull request generates this kind of discussion then it is not a good
candidate and it is better discard it, and this is what I am
going to do with this pull request.
Regards,
--
Roberto E. Vargas Caballero
Received on Thu Aug 07 2014 - 19:46:45 CEST