Skip to content

Commit 83a24ce

Browse files
authored
perf: drop clone (webtorrent#523)
1 parent b21a6a5 commit 83a24ce

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/client/udp-tracker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import arrayRemove from 'unordered-array-remove'
2-
import clone from 'clone'
32
import Debug from 'debug'
43
import dgram from 'dgram'
54
import Socks from 'socks'
@@ -11,6 +10,9 @@ import compact2string from 'compact2string'
1110

1211
const debug = Debug('bittorrent-tracker:udp-tracker')
1312

13+
// this was done some many years ago to fix "prevent Socks instances concurrency", and used some bloated package, no clue if it's needed, but this is simpler, #356
14+
const clone = obj => JSON.parse(JSON.stringify(obj))
15+
1416
/**
1517
* UDP torrent tracker client (for an individual tracker)
1618
*

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@
2727
},
2828
"type": "module",
2929
"dependencies": {
30-
"@thaunknown/simple-peer": "^10.0.6",
31-
"@thaunknown/simple-websocket": "^9.1.1",
30+
"@thaunknown/simple-peer": "^10.0.8",
31+
"@thaunknown/simple-websocket": "^9.1.3",
3232
"bencode": "^4.0.0",
3333
"bittorrent-peerid": "^1.3.6",
3434
"chrome-dgram": "^3.0.6",
35-
"clone": "^2.1.2",
3635
"compact2string": "^1.4.1",
3736
"cross-fetch-ponyfill": "^1.0.3",
3837
"debug": "^4.3.4",

0 commit comments

Comments
 (0)