replaced match with if to shorten the code
This commit is contained in:
parent
1cc719d413
commit
1481f3f477
@ -488,9 +488,7 @@ impl BlockChain {
|
||||
hash: hash,
|
||||
number: number,
|
||||
total_difficulty: total_difficulty,
|
||||
location: match is_new_best {
|
||||
false => BlockLocation::Branch,
|
||||
true => {
|
||||
location: if is_new_best {
|
||||
// on new best block we need to make sure that all ancestors
|
||||
// are moved to "canon chain"
|
||||
// find the route between old best block and the new one
|
||||
@ -506,7 +504,8 @@ impl BlockChain {
|
||||
route: route.blocks.into_iter().skip(route.index).collect()
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
BlockLocation::Branch
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user