更新读取时间不需要再插入
This commit is contained in:
@@ -522,10 +522,6 @@ impl Context {
|
|||||||
pub fn update_read_time(&self, id: &Ipv4Addr, route_key: &RouteKey) {
|
pub fn update_read_time(&self, id: &Ipv4Addr, route_key: &RouteKey) {
|
||||||
if let Some(mut time) = self.inner.route_table_time.get_mut(&(*route_key, *id)) {
|
if let Some(mut time) = self.inner.route_table_time.get_mut(&(*route_key, *id)) {
|
||||||
*time.value_mut() = Instant::now();
|
*time.value_mut() = Instant::now();
|
||||||
} else {
|
|
||||||
self.inner
|
|
||||||
.route_table_time
|
|
||||||
.insert((*route_key, *id), Instant::now());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user