Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 3 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
4 changes: 4 additions & 0 deletions primitives/session/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ where
T: ProvideRuntimeApi<Block>,
T::Api: SessionKeys<Block>,
{
if !seeds.is_empty() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it easier to:

if seeds.is_empty() {
  return Ok(())
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A question of style, after compilation it is strictly equivalent.

Copy link
Member

@davxy davxy Nov 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. But stylistically speaking maybe is better to early exit when the initial conditions are not met (just to avoid a dummy indentation over all the function body)

But this is only my opinion :-D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

return Ok(())
}

let runtime_api = client.runtime_api();

for seed in seeds {
Expand Down