Skip to content

Commit

Permalink
Fix typo and adjust buffer growth
Browse files Browse the repository at this point in the history
  • Loading branch information
flanglet committed Nov 25, 2023
1 parent fc97599 commit baa9fcc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v2/transform/LZCodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (this *LZCodec) Forward(src, dst []byte) (uint, uint, error) {
}

if &src[0] == &dst[0] {
return 0, 0, errors.New("Input and output mBufs cannot be equal")
return 0, 0, errors.New("Input and output buffers cannot be equal")
}

return this.delegate.Forward(src, dst)
Expand All @@ -115,7 +115,7 @@ func (this *LZCodec) Inverse(src, dst []byte) (uint, uint, error) {
}

if &src[0] == &dst[0] {
return 0, 0, errors.New("Input and output mBufs cannot be equal")
return 0, 0, errors.New("Input and output buffers cannot be equal")
}

return this.delegate.Inverse(src, dst)
Expand Down Expand Up @@ -503,11 +503,11 @@ func (this *LZXCodec) Forward(src, dst []byte) (uint, uint, error) {
}

if mIdx >= len(this.mBuf)-8 {
extraBuf1 := make([]byte, len(this.mBuf))
extraBuf1 := make([]byte, len(this.mBuf) / 2)
this.mBuf = append(this.mBuf, extraBuf1...)

if mLenIdx >= len(this.mLenBuf)-8 {
extraBuf2 := make([]byte, len(this.mLenBuf))
extraBuf2 := make([]byte, len(this.mLenBuf) / 2)
this.mLenBuf = append(this.mLenBuf, extraBuf2...)
}
}
Expand Down

0 comments on commit baa9fcc

Please sign in to comment.