some improvements
This commit is contained in:
parent
4b36805b55
commit
de6eacd001
@ -33,10 +33,10 @@ impl ObjectManager {
|
|||||||
}
|
}
|
||||||
pub fn insert(&mut self, sys_obj: Box<dyn ManagedSystemObject>) -> bool {
|
pub fn insert(&mut self, sys_obj: Box<dyn ManagedSystemObject>) -> bool {
|
||||||
let obj_id = sys_obj.get_object_id();
|
let obj_id = sys_obj.get_object_id();
|
||||||
if self.obj_map.contains_key(&obj_id) {
|
if self.obj_map.contains_key(obj_id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
self.obj_map.insert(obj_id.clone(), sys_obj).is_none()
|
self.obj_map.insert(*obj_id, sys_obj).is_none()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initializes all System Objects in the hash map and returns the number of successful
|
/// Initializes all System Objects in the hash map and returns the number of successful
|
||||||
|
Loading…
Reference in New Issue
Block a user