remove unnecessary check

This commit is contained in:
maskpp 2024-06-22 10:58:12 +08:00
parent 00675c5876
commit c8db8b785d

View file

@ -139,16 +139,14 @@ func (set *NodeSet) Size() (int, int) {
func (set *NodeSet) Summary() string { func (set *NodeSet) Summary() string {
var out = new(strings.Builder) var out = new(strings.Builder)
fmt.Fprintf(out, "nodeset owner: %v\n", set.Owner) fmt.Fprintf(out, "nodeset owner: %v\n", set.Owner)
if set.Nodes != nil { for path, n := range set.Nodes {
for path, n := range set.Nodes { // Deletion
// Deletion if n.IsDeleted() {
if n.IsDeleted() { fmt.Fprintf(out, " [-]: %x\n", path)
fmt.Fprintf(out, " [-]: %x\n", path) continue
continue
}
// Insertion or update
fmt.Fprintf(out, " [+/*]: %x -> %v \n", path, n.Hash)
} }
// Insertion or update
fmt.Fprintf(out, " [+/*]: %x -> %v \n", path, n.Hash)
} }
for _, n := range set.Leaves { for _, n := range set.Leaves {
fmt.Fprintf(out, "[leaf]: %v\n", n) fmt.Fprintf(out, "[leaf]: %v\n", n)