Comment by kazinator

Comment by kazinator 11 hours ago

0 replies

That's possible only if the condition is constant-foldable.

You can achieve it by turning the if part into an inline function.

Before:

  function(cond, arg)
  {
    if (cond) { true logic } else { false logic } 
  }
after:

  inline function(cond, arg) { cond ? function_true(arg) : function_false(arg) }
Now you don't do anything to those 37 places. The function is inlined, and the conditional disappears due to cond being constant.