From 494a70593002380145f768f24dfce6299f12654c Mon Sep 17 00:00:00 2001 From: Mikhail Kocharmin Date: Sun, 7 Apr 2024 19:06:33 +0300 Subject: [PATCH] data flow: perfomance improvement --- .../_src/CFGraph/DataFlow/data_flow_impl.h | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow_impl.h b/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow_impl.h index db33e73..cb8ae41 100644 --- a/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow_impl.h +++ b/sapfor/experts/Sapfor_2017/_src/CFGraph/DataFlow/data_flow_impl.h @@ -33,20 +33,18 @@ void DataFlowAnalysisNode::doStep() { if (in_cnt < next->out_cnt) { - for (const auto& byOut : next->getOut()) + const auto& byOut = next->getOut(); + bool inserted = addIn( byOut); + + if (inserted) { - bool inserted = addIn({ byOut }); + if (next->out_cnt > in_max_cnt) + in_max_cnt = next->out_cnt; - if (inserted) - { - if (next->out_cnt > in_max_cnt) - in_max_cnt = next->out_cnt; + inserted = forwardData(byOut); - inserted = forwardData({ byOut }); - - if (inserted && next->out_cnt > out_max_cnt) - out_max_cnt = next->out_cnt; - } + if (inserted && next->out_cnt > out_max_cnt) + out_max_cnt = next->out_cnt; } } }