Skip to content

Commit 0a6158f

Browse files
Copilotstephentoub
andcommitted
Remove redundant HasExited check in DisposeProcess else branch
After line 222 recomputes processRunning as `processRunning && !HasExited(process)`, the else branch already implies HasExited was true (when processRunning was originally true). The redundant check is unnecessary. Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent 50263cf commit 0a6158f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ModelContextProtocol.Core/Client/StdioClientTransport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ internal static void DisposeProcess(
227227
// and Node.js does not kill its children when it exits properly.
228228
process.KillTree(shutdownTimeout);
229229
}
230-
else if (HasExited(process))
230+
else
231231
{
232232
// The process has already exited. Call WaitForExit() (no arguments)
233233
// to ensure all redirected stderr/stdout events have been dispatched

0 commit comments

Comments
 (0)