• Klaus Post's avatar
    compress/flate: make compression level 0 consistent · 461adfd8
    Klaus Post authored
    Tests for determinism was not working as intended since io.Copybuffer
    uses the io.WriterTo if available.
    
    This exposed that level 0 (no compression) changed output
    based on the number of writes and buffers given to the
    writer.
    
    Previously, Write would emit a new raw block (BTYPE=00) for
    every non-empty call to Write.
    
    This CL fixes it such that a raw block is only emitted upon
    the following conditions:
     	* A full window is obtained (every 65535 bytes)
     	* Flush is called
     	* Close is called
    
    Change-Id: I807f866d97e2db7820f11febab30a96266a6cbf1
    Reviewed-on: https://go-review.googlesource.com/31174
    Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarJoe Tsai <thebrokentoaster@gmail.com>
    461adfd8
Name
Last commit
Last update
..
testdata Loading commit data...
deflate.go Loading commit data...
deflate_test.go Loading commit data...
deflatefast.go Loading commit data...
dict_decoder.go Loading commit data...
dict_decoder_test.go Loading commit data...
flate_test.go Loading commit data...
huffman_bit_writer.go Loading commit data...
huffman_bit_writer_test.go Loading commit data...
huffman_code.go Loading commit data...
inflate.go Loading commit data...
inflate_test.go Loading commit data...
reader_test.go Loading commit data...
reverse_bits.go Loading commit data...
token.go Loading commit data...
writer_test.go Loading commit data...