Skip to content

Commit

Permalink
reverse: refactor buffering using Config property instead of getter
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Jan 24, 2024
1 parent 5165d1d commit 92e104d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cmd/reverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
.no_headers(args.flag_no_headers);

// quadruple the buffer sizes as this is IO intensive
// this is our brute force way of speeding up the process
// as we can't really parallelize reversing a file
let mut rdr = rconfig
.clone()
.read_buffer(rconfig.get_read_buffer() * 4)
.read_buffer(rconfig.read_buffer * 4)
.reader()?;
let mut wtr = Config::new(&args.flag_output)
.write_buffer(rconfig.get_write_buffer() * 4)
.write_buffer(rconfig.write_buffer * 4)
.writer()?;

let Some(mut idx_file) = rconfig.indexed()? else {
Expand Down

0 comments on commit 92e104d

Please sign in to comment.