forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
p2p/discover: improve nodesByDistance.push code (ethereum#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>
- Loading branch information
1 parent
6891288
commit a9dfac0
Showing
2 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters