]> Sergey Matveev's repositories - btrtrc.git/commit
Drop bradfitz/iter dependency (#605)
authorYenForYang <YenForYang@users.noreply.github.com>
Tue, 14 Sep 2021 03:46:50 +0000 (22:46 -0500)
committerGitHub <noreply@github.com>
Tue, 14 Sep 2021 03:46:50 +0000 (13:46 +1000)
commita8db640c6236d028563096bd911d271a699a52d0
tree7849c07882b38fa5b6184f9cf262abc0db70d567
parent2203b3bcdf516347dfa66057feac7df5dde034db
Drop bradfitz/iter dependency (#605)

* Drop bradfitz/iter dependency

`range iter.N` looks nice and doesn't allocate, but unfortunately using a `range` expression blocks a function from being inlined wherever it's used (for now). It's not that we need inlining in all cases, but I do think a C-style for loop looks just as nice and is probably clearer to the majority. There also aren't any clear disadvantages to changing (unless you just happen to dislike the look of C)

* Update misc_test.go

* Update rlreader_test.go

* Update torrent_test.go

* Update bench_test.go

* Update client_test.go

* Update iplist_test.go

* Update mse_test.go

* Update peerconn_test.go

* Update peerconn.go

* Update order_test.go

* Update decoder_test.go

* Update main.go

* Update bench-piece-mark-complete.go

* Update main.go

* Update torrent.go

* Update iplist_test.go

* Update main.go
15 files changed:
bencode/bench_test.go
client_test.go
cmd/torrent-metainfo-pprint/main.go
cmd/torrent-verify/main.go
iplist/iplist_test.go
misc_test.go
mse/mse_test.go
peer_protocol/decoder_test.go
peerconn.go
peerconn_test.go
request-strategy/order_test.go
rlreader_test.go
storage/test/bench-piece-mark-complete.go
torrent.go
torrent_test.go