Introduce a lambda when translating if instead of calling k() twice to reduce code size