Open odeke-em opened 2 months ago
If we look at https://github.com/celestiaorg/nmt/blob/29e9433bd79eed40462000626ef987c91b0cf523/hasher.go#L157-L159
we notice this code https://github.com/celestiaorg/nmt/blob/29e9433bd79eed40462000626ef987c91b0cf523/hasher.go#L159
but that code could be made clearer, simpler and even faster (if in hot loop) by
emptyNs2X := bytes.Repeat([]byte{0}, int(n.NamespaceLen)*2) h := n.baseHasher.Sum(nil) digest := append(emptyNs2X, h...)
If we look at https://github.com/celestiaorg/nmt/blob/29e9433bd79eed40462000626ef987c91b0cf523/hasher.go#L157-L159
we notice this code https://github.com/celestiaorg/nmt/blob/29e9433bd79eed40462000626ef987c91b0cf523/hasher.go#L159
but that code could be made clearer, simpler and even faster (if in hot loop) by