Skip to content

Commit

Permalink
refactor(serialization): remove extra copy in serializeWithBufferAndI…
Browse files Browse the repository at this point in the history
…ndex
  • Loading branch information
xaviergonz authored and mbroadst committed Mar 12, 2018
1 parent abe97bc commit 47d44f2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/bson/bson.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,14 @@ BSON.prototype.serializeWithBufferAndIndex = function(object, finalBuffer, optio

// Attempt to serialize
var serializationIndex = serializer(
buffer,
finalBuffer,
object,
checkKeys,
startIndex || 0,
0,
serializeFunctions,
ignoreUndefined
);
buffer.copy(finalBuffer, startIndex, 0, serializationIndex);

// Return the index
return serializationIndex - 1;
Expand Down

0 comments on commit 47d44f2

Please sign in to comment.