Optimised ResourceManager::initPack() to not be O(n^2)