From 02c8a1276b3b4c5ce979380dac150bae9f0a2062 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Wed, 20 Sep 2023 09:24:24 +0200 Subject: [PATCH] avoid use of shallow (#636) this probably has some tiny overhead but it shouldn't practically matter --- eth/p2p/discovery.nim | 1 - tests/p2p/test_rlpx_thunk.nim | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/eth/p2p/discovery.nim b/eth/p2p/discovery.nim index 3788975..9f64226 100644 --- a/eth/p2p/discovery.nim +++ b/eth/p2p/discovery.nim @@ -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 type Neighbour = tuple[ip: IpAddress, udpPort, tcpPort: Port, pk: PublicKey] var nodes = newSeqOfCap[Neighbour](MAX_NEIGHBOURS_PER_PACKET) - shallow(nodes) template flush() = block: diff --git a/tests/p2p/test_rlpx_thunk.nim b/tests/p2p/test_rlpx_thunk.nim index 344e9d0..3c3bcb1 100644 --- a/tests/p2p/test_rlpx_thunk.nim +++ b/tests/p2p/test_rlpx_thunk.nim @@ -2,9 +2,9 @@ import std/[json, os], - unittest2, stint, + unittest2, chronos, stew/byteutils, - ../../eth/[p2p, common], + ../../eth/[p2p], ../stubloglevel, ./p2p_test_helper, ./eth_protocol