Skip to content

Commit

Permalink
build: removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
pamburus committed Dec 21, 2024
1 parent f4e2777 commit d0540ae
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,26 +629,12 @@ impl<II: Iterator<Item = usize>> Iterator for Blocks<IndexedInput, II> {
pub struct Block<I> {
input: Arc<I>,
index: usize,
buf_pool: Option<Arc<BufPool>>,
}

impl Block<IndexedInput> {
#[inline]
pub fn new(input: Arc<IndexedInput>, index: usize) -> Self {
Self {
input,
index,
buf_pool: None,
}
}

#[inline]
pub fn with_buf_pool(self, buf_pool: Arc<BufPool>) -> Self {
Self {
input: self.input,
index: self.index,
buf_pool: Some(buf_pool),
}
Self { input, index }
}

#[inline]
Expand Down Expand Up @@ -692,11 +678,7 @@ impl BlockLines<IndexedInput> {
pub fn new(mut block: Block<IndexedInput>) -> Result<Self> {
let (buf, total) = {
let block = &mut block;
let mut buf = if let Some(pool) = &block.buf_pool {
pool.check_out() // TODO: implement check-in
} else {
Vec::new()
};
let mut buf = Vec::new();
let source_block = block.source_block();
buf.resize(source_block.size.try_into()?, 0);
let mut stream = block.input.stream.lock().unwrap();
Expand All @@ -707,7 +689,7 @@ impl BlockLines<IndexedInput> {
};
Ok(Self {
block,
buf: Arc::new(buf), // TODO: optimize allocations
buf: Arc::new(buf),
total,
current: 0,
byte: 0,
Expand Down

0 comments on commit d0540ae

Please sign in to comment.