Skip to content

Commit 34182ee

Browse files
committed
byte aligning the start of an appendable is pointless
1 parent 2877641 commit 34182ee

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
@@ -2251,12 +2251,13 @@ fn EncodeData<Alloc: BrotliAlloc,
22512251
}
22522252
let mut catable_header_size = 0;
22532253
if let IsFirst::NothingWritten = s.is_first_mb {
2254-
if s.params.magic_number || (s.params.byte_align && !s.params.catable) {
2254+
if s.params.magic_number || (s.params.byte_align && !s.params.catable && !s.params.appendable) {
22552255
if s.params.magic_number {
22562256
BrotliWriteMetadataMetaBlock(&s.params, &mut storage_ix, (*s).storage_.slice_mut());
22572257
} else {
2258-
// magic and catable have their own headers that cause byte alignment
2259-
// so in those cases we don't need to force it here
2258+
// magic and catable have their own headers that cause byte alignment,
2259+
// and aligning the compressed data is pointless in appendable mode, so
2260+
// in those cases we don't need to force it here
22602261
BrotliStoreSyncMetaBlock(&mut storage_ix, (*s).storage_.slice_mut());
22612262
}
22622263
// XXX What does this do?

0 commit comments

Comments
 (0)