fix(tasks): eliminate target_id string clone during dependency mapping in UpdateTaskStatusHandler
This commit is contained in:
1 parent
478655698e
commit
1069096a29
1 file changed
+3
-3
@@ -159,7 +159,6 @@ impl McpTool for UpdateTaskStatusHandler {
|
|||||||
};
|
};
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
let target_id = tasks[target_idx].id.clone();
|
|
||||||
|
|
||||||
if target_status == "done" || target_status == "completed" {
|
if target_status == "done" || target_status == "completed" {
|
||||||
// 1. Check Acceptance Criteria
|
// 1. Check Acceptance Criteria
|
||||||
@@ -192,10 +191,11 @@ impl McpTool for UpdateTaskStatusHandler {
|
|||||||
|
|
||||||
// 3. Check child tasks
|
// 3. Check child tasks
|
||||||
if !blocked {
|
if !blocked {
|
||||||
|
let target_id_ref = tasks[target_idx].id.as_str();
|
||||||
let mut uncompleted_children = Vec::new();
|
let mut uncompleted_children = Vec::new();
|
||||||
for child in tasks
|
for child in tasks
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|t| t.parent_id.as_ref() == Some(&target_id))
|
.filter(|t| t.parent_id.as_deref() == Some(target_id_ref))
|
||||||
{
|
{
|
||||||
if child.status != "completed" && child.status != "done" {
|
if child.status != "completed" && child.status != "done" {
|
||||||
uncompleted_children.push(child.title.as_str());
|
uncompleted_children.push(child.title.as_str());
|
||||||
@@ -235,7 +235,7 @@ impl McpTool for UpdateTaskStatusHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(&start_idx) = id_to_idx.get(target_id.as_str()) {
|
if let Some(&start_idx) = id_to_idx.get(tasks[target_idx].id.as_str()) {
|
||||||
let mut queue = std::collections::VecDeque::new();
|
let mut queue = std::collections::VecDeque::new();
|
||||||
queue.push_back(start_idx);
|
queue.push_back(start_idx);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user