xgfone / go-bt

Another pure golang implementation of BitTorrent library.
Apache License 2.0
52 stars 13 forks source link

Fast merge arrays #4

Closed arpitjindal97 closed 2 years ago

arpitjindal97 commented 2 years ago

The existing code was dramatically complex and time-consuming

xgfone commented 2 years ago

Tks for your PR

It's good to use SET instead of ARRAY/SLICE to avoid allocating the memory over and over and eliminate duplication quickly. I think, however, it is unnecessary because it is only an example to let users understand how to use. It's OK to understand the meaning.

arpitjindal97 commented 2 years ago

True, It's only an example, but I feel most people will try to just copy-paste the code without touching it.

Up to you, can close.