feat: replace hardcoded buffer sizes with PIPESIZE constant
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use crate::common::PIPESIZE;
|
||||
use crate::services::error::CoreError;
|
||||
use crate::services::item_service::ItemService;
|
||||
use crate::services::types::{ItemWithContent, ItemWithMeta};
|
||||
@@ -204,7 +205,7 @@ impl AsyncItemService {
|
||||
// Apply offset by reading and discarding bytes
|
||||
if offset > 0 {
|
||||
let mut remaining = offset;
|
||||
let mut buf = [0; 8192];
|
||||
let mut buf = [0; PIPESIZE];
|
||||
while remaining > 0 {
|
||||
let to_read = std::cmp::min(remaining, buf.len() as u64);
|
||||
match reader.read(&mut buf[..to_read as usize]) {
|
||||
@@ -220,7 +221,7 @@ impl AsyncItemService {
|
||||
|
||||
// Read and send data up to the specified length
|
||||
let mut remaining_length = length;
|
||||
let mut buffer = [0; 8192];
|
||||
let mut buffer = [0; PIPESIZE];
|
||||
|
||||
loop {
|
||||
// Determine how much to read in this iteration
|
||||
|
||||
Reference in New Issue
Block a user