Skip to content

Commit

Permalink
Replace manual clamping with clamp function in search.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
willibrandon committed Jan 13, 2025
1 parent b997984 commit e06613b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rtrace_core/src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ pub fn search(config: &Config) -> io::Result<SearchResult> {
// Process large files with chunked parallel processing
if !large_files.is_empty() {
let chunk_size = (large_files.len() / rayon::current_num_threads())
.max(MIN_CHUNK_SIZE)
.min(MAX_CHUNK_SIZE);
.clamp(MIN_CHUNK_SIZE, MAX_CHUNK_SIZE);

let results: Vec<_> = large_files
.par_chunks(chunk_size)
Expand Down

0 comments on commit e06613b

Please sign in to comment.