From c68cd545863f47d3f3f49c9f9eeefb8055336065 Mon Sep 17 00:00:00 2001 From: Matthieu Monsch <1216372+mtth@users.noreply.github.com> Date: Sat, 30 Mar 2024 09:59:28 -0700 Subject: [PATCH] Update slow buffer creation calls (#456) cherry-picked from bce35cd Conflicts: - ES6 updates (e.g. var -> let) - platform lib - fully excising 'buffer' Signed-off-by: Oren Leiman --- lib/types.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/types.js b/lib/types.js index f4d644e6..ef73fd18 100644 --- a/lib/types.js +++ b/lib/types.js @@ -15,11 +15,10 @@ */ var utils = require('./utils'), - buffer = require('buffer'), // For `SlowBuffer`. + buffer = require('buffer'), util = require('util'); var Buffer = buffer.Buffer; -var SlowBuffer = buffer.SlowBuffer; // Convenience imports. var Tap = utils.Tap; @@ -48,7 +47,7 @@ var TYPES = { var RANDOM = new utils.Lcg(); // Encoding tap (shared for performance). -var TAP = new Tap(new SlowBuffer(1024)); +var TAP = new Tap(Buffer.allocUnsafeSlow(1024)); // Currently active logical type, used for name redirection. var LOGICAL_TYPE = null;