Skip to content

Commit 50d79c3

Browse files
committed
pass argument in ServerContext::set_crit_path_elements by ref, add ServerContext::clear_crit_path_elements
1 parent 3b9728c commit 50d79c3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

vpr/src/base/vpr_context.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,8 @@ class ServerContext : public Context {
577577
void set_path_type(const std::string& path_type) { path_type_ = path_type; }
578578
const std::string& path_type() const { return path_type_; }
579579

580-
void set_crit_path_elements(std::map<std::size_t, std::set<std::size_t>> crit_path_element_indexes) { crit_path_element_indexes_ = crit_path_element_indexes; }
580+
void clear_crit_path_elements() { crit_path_element_indexes_.clear(); }
581+
void set_crit_path_elements(const std::map<std::size_t, std::set<std::size_t>>& crit_path_element_indexes) { crit_path_element_indexes_ = crit_path_element_indexes; }
581582
std::map<std::size_t, std::set<std::size_t>> crit_path_element_indexes() const { return crit_path_element_indexes_; }
582583

583584
void set_draw_crit_path_contour(bool draw_crit_path_contour) { draw_crit_path_contour_ = draw_crit_path_contour; }

vpr/src/server/taskresolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void TaskResolver::processGetPathListTask(ezgl::application*, const TaskPtr& tas
101101
if (!options.hasErrors()) {
102102
ServerContext& server_ctx = g_vpr_ctx.mutable_server(); // shortcut
103103

104-
server_ctx.set_crit_path_elements(std::map<std::size_t, std::set<std::size_t>>{}); // reset selection if path list options has changed
104+
server_ctx.clear_crit_path_elements(); // reset selection if path list options has changed
105105

106106
// read options
107107
const int nCriticalPathNum = options.getInt(comm::OPTION_PATH_NUM, 1);

0 commit comments

Comments
 (0)