Skip to content

Commit

Permalink
fix(connect): Switch new Buffer(size) -> Buffer.alloc(size)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmillerick authored and mbroadst committed Oct 9, 2019
1 parent ee53983 commit da90c3a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/core/connection/msg.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
// [uint32 checksum;]
// };

const Buffer = require('safe-buffer').Buffer;
const opcodes = require('../wireprotocol/shared').opcodes;
const databaseNamespace = require('../wireprotocol/shared').databaseNamespace;
const ReadPreference = require('../topologies/read_preference');
Expand Down Expand Up @@ -90,7 +91,7 @@ class Msg {
flags |= OPTS_EXHAUST_ALLOWED;
}

const header = new Buffer(
const header = Buffer.alloc(
4 * 4 + // Header
4 // Flags
);
Expand All @@ -110,7 +111,7 @@ class Msg {
}

makeDocumentSegment(buffers, document) {
const payloadTypeBuffer = new Buffer(1);
const payloadTypeBuffer = Buffer.alloc(1);
payloadTypeBuffer[0] = 0;

const documentBuffer = this.serializeBson(document);
Expand Down

0 comments on commit da90c3a

Please sign in to comment.