correct checking for existence
This commit is contained in:
@@ -44,8 +44,8 @@ function generate_children(pcube::PolyCube, n_max::Int)
|
|||||||
for root_cube ∈ pcube.last_added
|
for root_cube ∈ pcube.last_added
|
||||||
for neighbor ∈ neighbors(root_cube...)
|
for neighbor ∈ neighbors(root_cube...)
|
||||||
pos_growth_candidates = searchsortedfirst(growth_candidates, neighbor)
|
pos_growth_candidates = searchsortedfirst(growth_candidates, neighbor)
|
||||||
# consider flipping following ||, it MAY imrove performance, leave the first IN PLACE!!!
|
# consider flipping following &&, it MAY imrove performance
|
||||||
if pos_growth_candidates > length(growth_candidates) || growth_candidates[pos_growth_candidates] != neighbor || !isempty(searchsorted(cubes, neighbor))
|
if (pos_growth_candidates > length(growth_candidates) || growth_candidates[pos_growth_candidates] != neighbor) && isempty(searchsorted(cubes, neighbor))
|
||||||
insert!(growth_candidates, pos_growth_candidates, neighbor)
|
insert!(growth_candidates, pos_growth_candidates, neighbor)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user