Skip to content

Commit

Permalink
Faster 1-level deep clone (BitMEX#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bomper authored and STRML committed Jan 8, 2018
1 parent 131288c commit 081f9d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion official-ws/nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,6 @@ function addStreamHelper(client, symbol, tableName, callback) {
}

function clone(data) {
return JSON.parse(JSON.stringify(data));
return data.map(o => Object.assign({}, o));
}

0 comments on commit 081f9d7

Please sign in to comment.