What is the explicit behaviour of ‘docker restart’?

The docker docs just say this command will “restart one or more containers”. But that isn’t clear enough for me.

Is this effectively;

if (container.isRunning) {
   docker stop container
   docker start container
} else {
   docker start container
}

?

ie. if the container isn’t running, it will be docker start‘ed, and if it is it will be stopped and then started again?

Source: StackOverflow