Skip to content

Commit

Permalink
decomp: remove double-ptr (#12130)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Oct 10, 2024
1 parent 4311fe9 commit 1e00a76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions erigon-lib/seg/decompress.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
type word []byte // plain text word associated with code from dictionary

type codeword struct {
pattern *word // Pattern corresponding to entries
pattern word // Pattern corresponding to entries
ptr *patternTable // pointer to deeper level tables
code uint16 // code associated with that word
len byte // Number of bits in the codes
Expand Down Expand Up @@ -355,7 +355,7 @@ func buildCondensedPatternTable(table *patternTable, depths []uint64, patterns [
if depth == depths[0] {
pattern := word(patterns[0])
//fmt.Printf("depth=%d, maxDepth=%d, code=[%b], codeLen=%d, pattern=[%x]\n", depth, maxDepth, code, bits, pattern)
cw := &codeword{code: code, pattern: &pattern, len: byte(bits), ptr: nil}
cw := &codeword{code: code, pattern: pattern, len: byte(bits), ptr: nil}
table.insertWord(cw)
return 1, nil
}
Expand Down Expand Up @@ -598,7 +598,7 @@ func (g *Getter) nextPattern() []byte {
table := g.patternDict

if table.bitLen == 0 {
return *table.patterns[0].pattern
return table.patterns[0].pattern
}

var l byte
Expand All @@ -617,7 +617,7 @@ func (g *Getter) nextPattern() []byte {
g.dataBit += 9
} else {
g.dataBit += int(l)
pattern = *cw.pattern
pattern = cw.pattern
}
g.dataP += uint64(g.dataBit / 8)
g.dataBit %= 8
Expand Down

0 comments on commit 1e00a76

Please sign in to comment.