Skip to content

Commit

Permalink
refactor: modified the code for compressStep function as per instruct…
Browse files Browse the repository at this point in the history
…ions (cosmos#149)
  • Loading branch information
xerpa43 authored Jul 12, 2023
1 parent d0edf8e commit daa1760
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions go/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,16 @@ func compressStep(step *InnerOp, lookup *[]*InnerOp, registry map[string]int32)
if err != nil {
panic(err)
}
sig := string(bz)

// load from cache if there
if num, ok := registry[sig]; ok {
if num, ok := registry[string(bz)]; ok {
return num
}

// create new step if not there
num := int32(len(*lookup))
*lookup = append(*lookup, step)
registry[sig] = num
registry[string(bz)] = num
return num
}

Expand Down

0 comments on commit daa1760

Please sign in to comment.