mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-01 00:31:21 +00:00
fix to no prealloc (because max size unknown)
This commit is contained in:
parent
fa6c709fcd
commit
7c2104e2e1
@ -118,11 +118,11 @@ func (c *Compressor2) Compress() error {
|
|||||||
go processSuperstring(superstrings, collector, c.minPatternScore, wg)
|
go processSuperstring(superstrings, collector, c.minPatternScore, wg)
|
||||||
}
|
}
|
||||||
i := 0
|
i := 0
|
||||||
c.superstring = make([]byte, 0, superstringLimit)
|
c.superstring = nil
|
||||||
if err := c.datFile.ForEach(func(word []byte) error {
|
if err := c.datFile.ForEach(func(word []byte) error {
|
||||||
if len(c.superstring)+2*len(word)+2 > superstringLimit {
|
if len(c.superstring)+2*len(word)+2 > superstringLimit {
|
||||||
superstrings <- c.superstring
|
superstrings <- c.superstring
|
||||||
c.superstring = make([]byte, 0, superstringLimit)
|
c.superstring = nil
|
||||||
}
|
}
|
||||||
for _, a := range word {
|
for _, a := range word {
|
||||||
c.superstring = append(c.superstring, 1, a)
|
c.superstring = append(c.superstring, 1, a)
|
||||||
|
Loading…
Reference in New Issue
Block a user