Skip to content

Commit

Permalink
fix: potential subtraction overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbillw committed Feb 6, 2024
1 parent a958849 commit 1d697f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/cestory/src/expert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub struct CesealExpertStub {
impl CesealExpertStub {
pub fn new(ceseal_props: CesealProperties) -> (Self, ExpertCmdReceiver) {
let (tx, rx) = mpsc::channel(16);
let thread_pool_cap = std::cmp::max(ceseal_props.cores - 1, 1);
let thread_pool_cap = ceseal_props.cores.saturating_sub(1).max(1);
let thread_pool = threadpool::ThreadPool::new(thread_pool_cap as usize);
info!("PODR2 compute thread pool capacity: {}", thread_pool.max_count());
let role = ceseal_props.role.clone();
Expand Down

0 comments on commit 1d697f4

Please sign in to comment.