mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-25 14:53:34 +00:00
perf(mcp): avoid reallocating SSE buffer on each chunk (#1153)
This commit is contained in:
@@ -212,9 +212,10 @@ impl HttpMcpTransport {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Keep only the unprocessed trailing fragment.
|
||||
// Keep only the unprocessed trailing fragment without allocating
|
||||
// a new String each iteration.
|
||||
if remaining_start > 0 {
|
||||
buffer = buffer[remaining_start..].to_string();
|
||||
buffer.drain(..remaining_start);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user