Function LegacyStorage::deleteOrphanedUrls() is responsible for the deletion of orphaned entries in the 'ezurl' table i.e. entries that do not have a correspondence in the 'ezurl_object_link' table. In essence, we are talking about URLs that are not linked to a content attribute through ezurl_object_link table.
This function is called when an object that has orphaned entries in 'ezurl' is edited and then the resulting draft is discarded.
It would be useful/advantageous to warn users that such orphaned entries are about to be deleted when the 'Discard draft' button is clicked.