mirror of https://github.com/ethereum/go-ethereum
p2p/discover: improve nodesByDistance.push code (#26019)
This improves readability of function 'push'. sort.Search(N, ...) will at most return N when no match, so ix should be compared with N. The previous version would compare ix with N+1 in case an additional item was appended. No bug resulted from this comparison, but it's not easy to understand why. Co-authored-by: Felix Lange <fjl@twurst.com>pull/26330/head
parent
6891288787
commit
a9dfac0332
Loading…
Reference in new issue