Skip to content

Commit

Permalink
Update slow buffer creation calls (mtth#456)
Browse files Browse the repository at this point in the history
cherry-picked from bce35cd

Conflicts:
  - ES6 updates (e.g. var -> let)
  - platform lib
  - fully excising 'buffer'

Signed-off-by: Oren Leiman <[email protected]>
  • Loading branch information
mtth authored and oleiman committed Jul 30, 2024
1 parent 778f8da commit c68cd54
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c68cd54

Please sign in to comment.