avoid use of shallow (#636)

this probably has some tiny overhead but it shouldn't practically matter
This commit is contained in:
Jacek Sieka 2023-09-20 09:24:24 +02:00 committed by GitHub
parent ac680ed79b
commit 02c8a1276b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -132,7 +132,6 @@ proc sendNeighbours*(d: DiscoveryProtocol, node: Node, neighbours: seq[Node]) =
const MAX_NEIGHBOURS_PER_PACKET = 12 # TODO: Implement a smarter way to compute it const MAX_NEIGHBOURS_PER_PACKET = 12 # TODO: Implement a smarter way to compute it
type Neighbour = tuple[ip: IpAddress, udpPort, tcpPort: Port, pk: PublicKey] type Neighbour = tuple[ip: IpAddress, udpPort, tcpPort: Port, pk: PublicKey]
var nodes = newSeqOfCap[Neighbour](MAX_NEIGHBOURS_PER_PACKET) var nodes = newSeqOfCap[Neighbour](MAX_NEIGHBOURS_PER_PACKET)
shallow(nodes)
template flush() = template flush() =
block: block:

View File

@ -2,9 +2,9 @@
import import
std/[json, os], std/[json, os],
unittest2, stint, unittest2,
chronos, stew/byteutils, chronos, stew/byteutils,
../../eth/[p2p, common], ../../eth/[p2p],
../stubloglevel, ../stubloglevel,
./p2p_test_helper, ./p2p_test_helper,
./eth_protocol ./eth_protocol