mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-21 03:46:37 +00:00
feat(ecstore): erasure encode reuse buf
This commit is contained in:
@@ -104,8 +104,8 @@ impl Erasure {
|
|||||||
let task = tokio::spawn(async move {
|
let task = tokio::spawn(async move {
|
||||||
let block_size = self.block_size;
|
let block_size = self.block_size;
|
||||||
let mut total = 0;
|
let mut total = 0;
|
||||||
|
let mut buf = vec![0u8; block_size];
|
||||||
loop {
|
loop {
|
||||||
let mut buf = vec![0u8; block_size];
|
|
||||||
match rustfs_utils::read_full(&mut reader, &mut buf).await {
|
match rustfs_utils::read_full(&mut reader, &mut buf).await {
|
||||||
Ok(n) if n > 0 => {
|
Ok(n) if n > 0 => {
|
||||||
total += n;
|
total += n;
|
||||||
@@ -122,7 +122,6 @@ impl Erasure {
|
|||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buf.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok((reader, total))
|
Ok((reader, total))
|
||||||
|
|||||||
Reference in New Issue
Block a user