Return when Finish() is called (makes it easier when we add stream comp)

This commit is contained in:
Eric MacDonald
2021-08-10 22:45:46 -04:00
committed by zefie
parent 002c221f05
commit a8f43ea5d5

View File

@@ -400,8 +400,6 @@ class WTVLzpf {
this.EncodeLiteral(code_length, code); this.EncodeLiteral(code_length, code);
} }
} }
return Buffer.from(this.encoded_data);
} }
/** /**
@@ -442,6 +440,8 @@ class WTVLzpf {
// End // End
this.AddByte((this.current_literal >>> 0x18) & 0xFF); this.AddByte((this.current_literal >>> 0x18) & 0xFF);
this.AddByte(0x20); this.AddByte(0x20);
return Buffer.from(this.encoded_data);
} }
/** /**
@@ -467,9 +467,7 @@ class WTVLzpf {
uncompressed_data = this.ConvertToBuffer(uncompressed_data); uncompressed_data = this.ConvertToBuffer(uncompressed_data);
this.Begin(); this.Begin();
this.EncodeBlock(uncompressed_data, true); this.EncodeBlock(uncompressed_data, true);
this.Finish(); return this.Finish();
return Buffer.from(this.encoded_data);
} }
} }