doc to create_hash_map

This commit is contained in:
Volodymyr Patuta 2020-10-31 20:42:26 +01:00
parent ca1303a8eb
commit 22dbb0e1b7
1 changed files with 1 additions and 0 deletions

View File

@ -41,6 +41,7 @@ fn check_collisions(r: &robot::Robot, h: &HashMap<robot::Position, u32>) -> Resu
} }
} }
/// Creates HashMap of robot position and it's id.
fn create_hash_map(pool: &Vec<robot::Robot>, hash: &mut HashMap<robot::Position, u32>) { fn create_hash_map(pool: &Vec<robot::Robot>, hash: &mut HashMap<robot::Position, u32>) {
for r in pool { for r in pool {
hash.insert(robot::Position { x: r.p.x, y: r.p.y }, r.id); hash.insert(robot::Position { x: r.p.x, y: r.p.y }, r.id);