remove unecessary dict, use other way to remove keys
Merge pull request #8101 from hvnsweeting/pkgrepo_refactor

remove unecessary dict, use other way to remove keys