assistant2: More improvement to prompt building efficiency (#22941)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-01-09 21:40:11 -07:00 committed by GitHub
parent ec4c6744d6
commit 0d6a549950
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 54 additions and 35 deletions

View file

@ -462,13 +462,12 @@ fn to_fenced_codeblock(path: &Path, content: Rope) -> SharedString {
buffer.push_str("```\n");
if buffer.len() > capacity {
log::error!(
"to_fenced_codeblock calculated capacity {} but length was {}",
capacity,
buffer.len()
);
}
debug_assert!(
buffer.len() == capacity - 1 || buffer.len() == capacity,
"to_fenced_codeblock calculated capacity of {}, but length was {}",
capacity,
buffer.len(),
);
buffer.into()
}