Remove function calls in loop conditions