Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some spelling fixes and excludes #621

Merged
merged 2 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,43 @@
"coverage-gutters.coverageFileNames": [
"lcov.info"
],
"cSpell.ignoreRegExpList": [
"/\"[^\"]*\\\\u{1b}\\[[^\"]*\"/g",
"/r#\".*\\\\u001b\\[.*\"#/g",
"/\"[^\"]*\\\\x1b\\[[^\"]*\"/g"
],
"cSpell.words": [
"AKBNIJGHERHBNMCKJABHSDJ",
"amet",
"ampm",
"april",
"bfnrt",
"bytefmt",
"cdef",
"cpus",
"Deque",
"EVFILT",
"february",
"FFNOP",
"friday",
"ibuf",
"itoa",
"january",
"july",
"june",
"naaaa",
"nbbbb",
"november",
"october",
"orem",
"psum",
"saturday",
"stty",
"thursday",
"tuesday",
"unexp",
"unhex",
"wednesday",
"wyhash"
]
}
26 changes: 3 additions & 23 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use crate::{
error::{Result, HILITE},
index::{Index, Indexer, SourceBlock, SourceMetadata},
iox::ReadFill,
pool::SQPool,
replay::{ReplayBufCreator, ReplayBufReader, ReplaySeekReader},
tee::TeeReader,
vfs::{FileSystem, LocalFileSystem},
Expand All @@ -29,7 +28,6 @@ use crate::{

pub type SequentialStream = Box<dyn ReadMeta + Send + Sync>;
pub type RandomAccessStream = Box<dyn ReadSeekMeta + Send + Sync>;
pub type BufPool = SQPool<Vec<u8>>;

// ---

Expand Down Expand Up @@ -629,26 +627,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 +676,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.checkout() // TODO: implement checkin
} 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 +687,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
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ mod filtering;
mod formatting;
mod fsmon;
mod model;
mod pool;
mod replay;
mod scanning;
mod serdex;
Expand Down
177 changes: 0 additions & 177 deletions src/pool.rs

This file was deleted.

Loading