Skip to content

Commit 1709785

Browse files
authored
Merge pull request #46 from JuliaCollections/feature/memoize-dict-in-Main
Use Main instead of `@__MODULE__` to hold memoization Dict
2 parents 0e48ecf + c4d39de commit 1709785

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Memoize.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ macro memoize(args...)
4747
end
4848

4949
fcachename = Symbol("##", f, "_memoized_cache")
50-
mod = @__MODULE__
51-
fcache = isdefined(mod, fcachename) ?
52-
getfield(mod, fcachename) :
53-
Core.eval(mod, :(const $fcachename = ($dicttype)()))
50+
fcache = isdefined(Main, fcachename) ?
51+
getfield(Main, fcachename) :
52+
Core.eval(Main, :(const $fcachename = ($dicttype)()))
5453

5554
if length(kws) == 0
5655
lookup = :($fcache[($(tup...),)]::Core.Compiler.return_type($u, typeof(($(identargs...),))))

0 commit comments

Comments
 (0)