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 7cca33c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 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,8 @@ 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 Expand Up @@ -425,6 +425,7 @@ Type.isType = function (/* any, [prefix] ... */) {
return false;
}


var any = arguments[0];
if (
!any ||
Expand Down

0 comments on commit 7cca33c

Please sign in to comment.