// Check that the sibling data hashes to the first side node if not nil
if proof.SiblingData == nil {
return true
}
if len(proof.SideNodes) == 0 {
return true
}
siblingHash := th.digest(proof.SiblingData)
return bytes.Equal(proof.SideNodes[0], siblingHash)
If we look at the code in here https://github.com/celestiaorg/smt/blob/a99c0f5249884312ab8e6864fe165371c0f461ba/proofs.go#L44-L54
Notice
Those nested conditions could be further simplified from
Before
https://github.com/celestiaorg/smt/blob/a99c0f5249884312ab8e6864fe165371c0f461ba/proofs.go#L45-L52
After