You don't need this `if`. If submodules is an empty list, then there's no harm in looping over it.