I think you're making a good point @nilsi, but in this case I would personally think it's better to go with Fredrik's solution, as I think the redundant code will pose a bigger problem than the if-statements.
(however, @fredrikpersson , I think it would be a good idea to move down some ending c-ifs to a new line, to increase the readability, to easily see where an if-statement ends)