Skip to content

Commit

Permalink
Updated example: changed the len to CompressBlockBound func to determ…
Browse files Browse the repository at this point in the history
…ine the buffer size so that the code can be used to determine buf length for any length of string.
  • Loading branch information
Sathesh Sivashanmugam committed Jan 13, 2022
1 parent a134e63 commit 953bb25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func Example() {
func ExampleCompressBlock() {
s := "hello world"
data := []byte(strings.Repeat(s, 100))
buf := make([]byte, len(data))
buf := make([]byte, lz4.CompressBlockBound(len(data)))

var c lz4.Compressor
n, err := c.CompressBlock(data, buf)
Expand Down

0 comments on commit 953bb25

Please sign in to comment.