The method SchemaManager::dropDatabases() loops on every collection to remove its database. But since collections are usually all in the same database, this executes the "dropDatabase" operation multiple times on the same database.
This is not problematic since dropDatabase is idempotent, but this can be optimized by executing "dropDatabase" only once per database to drop.