Skip to content

Commit 4bc837f

Browse files
committed
Avoid nesting precomputed and memoized heuristics.
1 parent b3ba69b commit 4bc837f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/heuristics/precomputed.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,11 @@ that prevents repeated pre-computation later.
4646
"""
4747
precomputed(h::Heuristic, domain::Domain, args...) =
4848
PrecomputedHeuristic(h, domain, args...)
49+
50+
function precomputed(h::MemoizedHeuristic, domain::Domain, args...)
51+
if h.heuristic isa PrecomputedHeuristic
52+
ensure_precomputed!(h.heuristic.heuristic, domain, args...)
53+
return h
54+
end
55+
return MemoizedHeuristic(precomputed(h.heuristic, domain, args...), h.cache)
56+
end

0 commit comments

Comments
 (0)