mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-10-24 06:12:38 +00:00
Manually implement absorb_second in RouterInner
This allows us to avoid a clone on the routelist Arc. Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
1 file changed
+16
@@ -637,6 +637,22 @@ impl left_right::Absorb<RoutingTableOplogEntry> for RoutingTableInner {
|
||||
self.table.insert(k, ss, v.clone());
|
||||
}
|
||||
}
|
||||
|
||||
fn absorb_second(&mut self, operation: RoutingTableOplogEntry, _: &Self) {
|
||||
match operation {
|
||||
RoutingTableOplogEntry::Upsert(subnet, list) => {
|
||||
self.table.insert(
|
||||
expect_ipv6(subnet.address()),
|
||||
subnet.prefix_len().into(),
|
||||
list,
|
||||
);
|
||||
}
|
||||
RoutingTableOplogEntry::Delete(subnet) => {
|
||||
self.table
|
||||
.remove(expect_ipv6(subnet.address()), subnet.prefix_len().into());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for RoutingTable {
|
||||
|
||||
Reference in new issue
Block a user