some improvements

This commit is contained in:
Robin Müller 2022-05-15 10:27:27 +02:00
parent 4b36805b55
commit de6eacd001
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -33,10 +33,10 @@ impl ObjectManager {
}
pub fn insert(&mut self, sys_obj: Box<dyn ManagedSystemObject>) -> bool {
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;
}
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