Explorar o código

Only check data views with the same top-level variable name

Michael Ragazzon hai 1 ano
pai
achega
6144d10137
Modificáronse 1 ficheiros con 5 adicións e 11 borrados
  1. 5 11
      Source/Core/DataView.cpp

+ 5 - 11
Source/Core/DataView.cpp

@@ -121,18 +121,12 @@ bool DataViews::Update(DataModel& model, const DirtyVariables& dirty_variables)
 		for (const String& variable_name : dirty_variables)
 		{
 			DataAddress address = model.ResolveAddress(variable_name, nullptr);
-			if (address.size() > 1)
-			{
-				for (const DataViewPtr& view : views)
-				{
-					if (view->HasAddressDependency(address))
-						dirty_views.push_back(view.get());
-				}
-			}
-			else
+			if (address.empty())
+				continue;
+			auto pair = name_view_map.equal_range(address.front().name);
+			for (auto it = pair.first; it != pair.second; ++it)
 			{
-				auto pair = name_view_map.equal_range(variable_name);
-				for (auto it = pair.first; it != pair.second; ++it)
+				if (address.size() <= 1 || it->second->HasAddressDependency(address))
 					dirty_views.push_back(it->second);
 			}
 		}