Update main.rs

move stdout flush in Greedy-Search to after print statement
This commit is contained in:
Daniel S. 2019-06-17 02:22:45 +02:00
parent ed53d5a3f0
commit d42121c33b
1 changed files with 1 additions and 1 deletions

View File

@ -516,7 +516,6 @@ impl Router {
));
seen.insert(start_sys.id);
while !(queue.is_empty() || found) {
std::io::stdout().flush().unwrap();
while let Some((_, _, depth, sys)) = queue.pop() {
if depth > maxd {
maxd = depth;
@ -528,6 +527,7 @@ impl Router {
seen.len(),
((seen.len() * 100) as f32) / total
);
std::io::stdout().flush().unwrap();
}
if sys.id == goal_sys.id {
found = true;