Skip to content

Commit 25735a9

Browse files
committed
byte aligning the start of an appendable is pointless
1 parent 68e6634 commit 25735a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/enc/encode.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,12 +2255,13 @@ fn EncodeData<Alloc: BrotliAlloc,
22552255
}
22562256
let mut catable_header_size = 0;
22572257
if let IsFirst::NothingWritten = s.is_first_mb {
2258-
if s.params.magic_number || (s.params.byte_align && !s.params.catable) {
2258+
if s.params.magic_number || (s.params.byte_align && !s.params.catable && !s.params.appendable) {
22592259
if s.params.magic_number {
22602260
BrotliWriteMetadataMetaBlock(&s.params, &mut storage_ix, (*s).storage_.slice_mut());
22612261
} else {
2262-
// magic and catable have their own headers that cause byte alignment
2263-
// so in those cases we don't need to force it here
2262+
// magic and catable have their own headers that cause byte alignment,
2263+
// and aligning the compressed data is pointless in appendable mode, so
2264+
// in those cases we don't need to force it here
22642265
BrotliStoreSyncMetaBlock(&mut storage_ix, (*s).storage_.slice_mut());
22652266
}
22662267
// XXX What does this do?

0 commit comments

Comments
 (0)