From 0ba87a2d707b548265fde060d40279ca497fab51 Mon Sep 17 00:00:00 2001 From: codeboss <2422523675@qq.com> Date: Sat, 5 Oct 2024 10:19:24 +0800 Subject: [PATCH] 1 --- StoryPresent/dag_layout.cpp | 6 +++--- StoryPresent/dag_layout.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/StoryPresent/dag_layout.cpp b/StoryPresent/dag_layout.cpp index 8d048b5..6d9c9a6 100644 --- a/StoryPresent/dag_layout.cpp +++ b/StoryPresent/dag_layout.cpp @@ -153,7 +153,7 @@ std::shared_ptr DAGGraph::spawns_peak(QList(); } -void DAGGraph::graph_recovery(QList> sort_seqs) { +void DAGGraph::graph_recovery(const QList> &sort_seqs) { for (auto it : sort_seqs) { it->inputCount() = 0; } @@ -170,7 +170,7 @@ void DAGGraph::graph_recovery(QList> sort_seqs) } } -int DAGGraph::node_layering(std::shared_ptr inst, int layer_current) { +int DAGGraph::node_layering(const std::shared_ptr &inst, int layer_current) { auto max_remains = layer_current; if (!layer_current || inst->layerValue() < layer_current) { inst->setLayerValue(layer_current); @@ -228,7 +228,7 @@ QList> DAGGraph::tidy_graph_nodes() { } #include -void DAGGraph::graph_layer_nodes_sort(int layer_index, QList> nodes) { +void DAGGraph::graph_layer_nodes_sort(int layer_index, const QList> &nodes) { QList> nodes_within_current_layer; for (auto n : nodes) if (n->layerNumber() == layer_index) { diff --git a/StoryPresent/dag_layout.h b/StoryPresent/dag_layout.h index cba2f24..241d57e 100644 --- a/StoryPresent/dag_layout.h +++ b/StoryPresent/dag_layout.h @@ -82,11 +82,11 @@ namespace dags { private: std::shared_ptr spawns_peak(QList>& ref_set); - void graph_recovery(QList> sort_seqs); - int node_layering(std::shared_ptr inst, int layer_current); + void graph_recovery(const QList> &sort_seqs); + int node_layering(const std::shared_ptr &inst, int layer_current); int node_layering_adj(std::shared_ptr inst); QList> tidy_graph_nodes(); - void graph_layer_nodes_sort(int layer_index, QList> nodes); - + void graph_layer_nodes_sort(int layer_index, const QList> &nodes); +// void above_node_sort(int curr_layer, ) }; }