Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e327108

Browse files
fix: use Buffer.alloc (mzgoddard#402)
1 parent 8885f10 commit e327108

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎lib/SerializerAppend2.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ const TMP_CHUNK = 0.5 * 1024 * 1024;
3333
const MAX_CHUNK_PLUS = 2.5 * 1024 * 1024;
3434
const LARGE_CONTENT = 64 * 1024;
3535

36-
let tmpBuffer = newBuffer(TMP_CHUNK);
37-
let outBuffer = newBuffer(MAX_CHUNK_PLUS);
36+
let tmpBuffer = Buffer.allocUnsafe(TMP_CHUNK);
37+
let outBuffer = Buffer.allocUnsafe(MAX_CHUNK_PLUS);
3838

3939
const _buffers = [];
4040

@@ -143,9 +143,9 @@ class Append2 {
143143
this.path = path;
144144
this.autoParse = autoParse;
145145

146-
this.inBuffer = newBuffer(0);
146+
this.inBuffer = Buffer.alloc(0);
147147
this._buffers = [];
148-
this.outBuffer = newBuffer(0);
148+
this.outBuffer = Buffer.alloc(0);
149149
}
150150

151151
async _readFile(file) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /