Browse Source

reverted invalidation attempt

pull/2/head
alexge50 3 years ago
parent
commit
adb8c39324
  1. 3
      gie/src/ScriptGraph/Execute.cpp
  2. 12
      gie/src/ScriptGraph/ScriptGraph.cpp

3
gie/src/ScriptGraph/Execute.cpp

@ -88,6 +88,9 @@ MaybeError<ExecutionInterfaceError> executeNode(const PythonContext& context, Sc
MaybeError<std::vector<ExecutionInterfaceError>> executeGraph(const PythonContext& context, ScriptGraph &graph)
{
for(auto& cache: graph.cache)
cache.first = std::nullopt;
std::vector<ExecutionInterfaceError> nodeErrors;
for(const auto& node: graph.nodes)

12
gie/src/ScriptGraph/ScriptGraph.cpp

@ -21,15 +21,6 @@ static unsigned long long lookup(const ScriptGraph& graph, NodeId id)
return it == graph.nodes.end() ? NotFound : std::distance(graph.nodes.begin(), it);
}
static void invalidateNodes(ScriptGraph& graph, NodeId id)
{
*(getNode(graph, id).value().cache) = std::nullopt;
graph.structure.iterateOutNeighbours(id, [&graph](NodeId dependant)
{
invalidateNodes(graph, dependant);
});
}
Expected<NodeCachePair, NodeInterfaceError> getNode(ScriptGraph& graph, NodeId id)
{
const auto r = lookup(graph, id);
@ -85,7 +76,6 @@ MaybeError<NodeInterfaceError> editNode(ScriptGraph& graph, NodeId id, ArgumentI
graph.structure.addEdge(otherId, id);
}
invalidateNodes(graph, id);
return {};
}
@ -117,7 +107,6 @@ MaybeError<NodeInterfaceError> updateNode(ScriptGraph& graph, NodeId id)
}
}
invalidateNodes(graph, id);
return {};
}
@ -149,7 +138,6 @@ MaybeError<NodeInterfaceError> removeNode([[maybe_unused]]ScriptGraph& graph, [[
editNode(graph, other, ArgumentId{argumentId}, {NoArgument{}}).discard();
});
invalidateNodes(graph, id);
graph.structure.removeNode(id);
return {};

Loading…
Cancel
Save