mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-11-29 23:46:35 -05:00
fix fox nodes length issue
This commit is contained in:
parent
fe8e963af7
commit
cff955782b
4 changed files with 20 additions and 8 deletions
|
|
@ -1054,8 +1054,8 @@ impl RoutingTableInner {
|
|||
nodes.sort_by(|a, b| compare(self, a, b));
|
||||
|
||||
// return transformed vector for filtered+sorted nodes
|
||||
let cnt = usize::min(node_count, nodes.len());
|
||||
let mut out = Vec::<O>::with_capacity(cnt);
|
||||
nodes.truncate(node_count);
|
||||
let mut out = Vec::<O>::with_capacity(nodes.len());
|
||||
for node in nodes {
|
||||
let val = transform(self, node);
|
||||
out.push(val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue