The code could have been simpler, but irrespective of that, Djikstra is greedy, so at each node, we try to find the node with the shortest path. Unless there are negative edges, then nodes that are already visited would already be populated with the shortest path, so naturally, the condition if (distanceThroughU < v.minDistance) will never be true for visited nodes.
Regarding the run time complexity, there would be not much difference between your two implementations.