don't do a hashmap lookup while iterating the hashmap
This commit is contained in:
committed by
Mathias Agopian
parent
4b1a451804
commit
3fa9b08a52
@@ -563,9 +563,13 @@ const DebugServer::MaterialRecord* DebugServer::getRecord(const MaterialKey& key
|
||||
|
||||
void DebugServer::updateActiveVariants() {
|
||||
if (mQueryCallback) {
|
||||
for (auto& pair : mMaterialRecords) {
|
||||
VariantList& result = mMaterialRecords[pair.first].activeVariants;
|
||||
mQueryCallback(pair.second.userdata, &result);
|
||||
auto curr = mMaterialRecords.begin();
|
||||
auto end = mMaterialRecords.end();
|
||||
while (curr != end) {
|
||||
auto& value = curr.value();
|
||||
VariantList& result = value.activeVariants;
|
||||
mQueryCallback(value.userdata, &result);
|
||||
++curr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user