Commits

shl...@b384bcd7-cfd4-0310-aca0-d78b80f7b91b  committed 091a42f

Convert a foreach { if { push } } loop to grep.

  • Participants
  • Parent commits 5f40e45

Comments (0)

Files changed (1)

File abc-path/generator/generate-abs-path.pl

                 my $int = pop(@connectivity_stack);
                 $connected{$int} = 1;
 
-                foreach my $next_int (
-                    @{ $self->_get_next_cells($last_state, $int) }
-                )
-                {
-                    if (!exists($connected{$next_int}))
-                    {
-                        push @connectivity_stack, $next_int;
-                    }
-                }
+                push @connectivity_stack, 
+                    (grep { !exists($connected{$_}) } 
+                        @{ $self->_get_next_cells($last_state, $int) }
+                    );
             }
 
             if (