perf: generate_initial_session_keys: load runtime only if its relevant (#12651)

* perf: generate_initial_session_keys: load runtime only if its relevant

* apply review suggestion

* Update primitives/session/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Éloïs
2022-11-22 18:34:07 +01:00
committed by GitHub
parent 1b5d52deb2
commit e429ef1d95
+4
View File
@@ -118,6 +118,10 @@ where
T: ProvideRuntimeApi<Block>,
T::Api: SessionKeys<Block>,
{
if seeds.is_empty() {
return Ok(())
}
let runtime_api = client.runtime_api();
for seed in seeds {