Skip to content

Commit 4fbc990

Browse files
committed
perf(F14): ⚡ Optimize perf when todo task id is equal 0
1 parent bae5837 commit 4fbc990

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Src/Core/F14/BusinessLogic/F14Service.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,17 @@ CancellationToken ct
3333
return F14Constant.DefaultResponse.App.TODO_TASK_LIST_NOT_FOUND;
3434
}
3535

36-
var doesTaskExist = await _repository.Value.DoesTodoTaskExistAsync(
37-
request.TodoTaskId,
38-
request.TodoTaskListId,
39-
ct
40-
);
41-
if (!doesTaskExist && request.TodoTaskId != 0)
36+
if (request.TodoTaskId != 0)
4237
{
43-
return F14Constant.DefaultResponse.App.TASK_NOT_FOUND;
38+
var doesTaskExist = await _repository.Value.DoesTodoTaskExistAsync(
39+
request.TodoTaskId,
40+
request.TodoTaskListId,
41+
ct
42+
);
43+
if (!doesTaskExist)
44+
{
45+
return F14Constant.DefaultResponse.App.TASK_NOT_FOUND;
46+
}
4447
}
4548

4649
var input = new F14GetTodoTasksInputModel

0 commit comments

Comments
 (0)