From bd9a8aa22b4e0d83ea7cfb7c5e9f7b86adec9211 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 29 Jun 2019 10:43:57 +0200 Subject: [PATCH] Don't repeat the logic from Default impl (#10813) --- parity/configuration.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/parity/configuration.rs b/parity/configuration.rs index 2a807e99b..541637fd4 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -933,13 +933,13 @@ impl Configuration { } fn snapshot_config(&self) -> Result { - 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) }