Don't repeat the logic from Default impl (#10813)

This commit is contained in:
David 2019-06-29 10:43:57 +02:00 committed by Marek Kotewicz
parent 8fc504eb1a
commit bd9a8aa22b
1 changed files with 7 additions and 7 deletions

View File

@ -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)
}