I was thinking of a more general solution like `result = current_code; result == 0 ? processor_count : result`
would that work for you ?