Refactor and improve collections code

#3043
This commit is contained in:
Wojtek Figat
2025-01-23 14:44:11 +01:00
parent af416fe0c8
commit f5280eab74
13 changed files with 277 additions and 268 deletions

View File

@@ -335,17 +335,17 @@ void MCore::UnloadEngine()
void MCore::ReloadScriptingAssemblyLoadContext()
{
// Clear any cached class attributes (see https://github.com/FlaxEngine/FlaxEngine/issues/1108)
for (auto e : CachedClassHandles)
for (const auto& e : CachedClassHandles)
{
e.Value->_hasCachedAttributes = false;
e.Value->_attributes.Clear();
}
for (auto e : CachedAssemblyHandles)
for (const auto& e : CachedAssemblyHandles)
{
MAssembly* a = e.Value;
if (!a->IsLoaded() || !a->_hasCachedClasses)
continue;
for (auto q : a->GetClasses())
for (const auto& q : a->GetClasses())
{
MClass* c = q.Value;
c->_hasCachedAttributes = false;