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

Don't reimplement the logic from the Default impl #10813

Merged
merged 1 commit into from
Jun 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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