Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Don't repeat the logic from Default impl (#10813)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdplm authored and debris committed Jun 29, 2019
1 parent 8fc504e commit bd9a8aa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions parity/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -933,13 +933,13 @@ impl Configuration {
}

fn snapshot_config(&self) -> Result<SnapshotConfiguration, String> {
let conf = SnapshotConfiguration {
no_periodic: self.args.flag_no_periodic_snapshot,
processing_threads: match self.args.arg_snapshot_threads {
Some(threads) if threads > 0 => threads,
_ => ::std::cmp::max(1, num_cpus::get_physical() / 2),
},
};
let mut conf = SnapshotConfiguration::default();
conf.no_periodic = self.args.flag_no_periodic_snapshot;
if let Some(threads) = self.args.arg_snapshot_threads {
if threads > 0 {
conf.processing_threads = threads;
}
}

Ok(conf)
}
Expand Down

0 comments on commit bd9a8aa

Please sign in to comment.