The rule of thumb I use is to only have one return after modifying state that will persist outside the function call.