summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Barrett <tombarrett@siu.edu>2017-11-23 05:33:51 -0600
committerTom Barrett <tombarrett@siu.edu>2017-11-23 05:33:51 -0600
commitfb20a0f84419dab4c8949d9a9ca30d3b75f9665c (patch)
tree7fd94a3d42f3248595bea635851fc0d2241665e9 /src
parentce594dbdc346bef9b951b56e5eb103a0029c4d11 (diff)
-i believe this will be faster
Diffstat (limited to 'src')
-rw-r--r--src/list.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/list.rs b/src/list.rs
index c22c229..6c07c01 100644
--- a/src/list.rs
+++ b/src/list.rs
@@ -26,10 +26,12 @@ impl List {
let location = self.men[i].location.clone();
let free_locations = self.get_free_locations(location);
self.men[i].action(free_locations);
+ }
+ let impassable = self.get_all_impassable();
+ for i in 0..self.men.len() {
if self.men[i].needs_path {
- let impassable = self.get_all_impassable();
- self.men[i].calculate_path(impassable);
+ self.men[i].calculate_path(impassable.to_vec());
}
}
}