Skip to content

Commit

Permalink
Update slow buffer creation calls (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtth authored Mar 30, 2024
1 parent b3966cb commit bce35cd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
*/

let utils = require('./utils'),
platform = require('./platform'),
buffer = require('buffer'); // For `SlowBuffer`.

let Buffer = buffer.Buffer;
let SlowBuffer = buffer.SlowBuffer;
platform = require('./platform');

// Convenience imports.
let Tap = utils.Tap;
Expand All @@ -32,7 +28,7 @@ let TYPES;
let RANDOM = new utils.Lcg();

// Encoding tap (shared for performance).
let TAP = new Tap(new SlowBuffer(1024));
let TAP = new Tap(Buffer.allocUnsafeSlow(1024));

// Currently active logical type, used for name redirection.
let LOGICAL_TYPE = null;
Expand Down Expand Up @@ -443,7 +439,7 @@ class Type {

static __reset (size) {
debug('resetting type buffer to %d', size);
TAP.buf = new SlowBuffer(size);
TAP.buf = Buffer.allocUnsafeSlow(size);
}

get branchName () {
Expand Down

0 comments on commit bce35cd

Please sign in to comment.