Skip to content

Commit daa1760

Browse files
authored
refactor: modified the code for compressStep function as per instructions (#149)
1 parent d0edf8e commit daa1760

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

go/compress.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,16 @@ func compressStep(step *InnerOp, lookup *[]*InnerOp, registry map[string]int32)
9393
if err != nil {
9494
panic(err)
9595
}
96-
sig := string(bz)
9796

9897
// load from cache if there
99-
if num, ok := registry[sig]; ok {
98+
if num, ok := registry[string(bz)]; ok {
10099
return num
101100
}
102101

103102
// create new step if not there
104103
num := int32(len(*lookup))
105104
*lookup = append(*lookup, step)
106-
registry[sig] = num
105+
registry[string(bz)] = num
107106
return num
108107
}
109108

0 commit comments

Comments
 (0)