Skip to content

Commit 6acc6a0

Browse files
committed
Remove the need to preload exports
1 parent ad1ffd2 commit 6acc6a0

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

lib/elixir/lib/module/parallel_checker.ex

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,27 +185,19 @@ defmodule Module.ParallelChecker do
185185
{checker, :gen_server.call(checker, :ets, :infinity)}
186186
end
187187

188-
@doc """
189-
Preloads a module into the cache. Call this function before any other
190-
cache lookups for the module.
191-
"""
192-
@spec preload_module(cache(), module()) :: :ok
193-
def preload_module({server, ets}, module) do
194-
case :ets.lookup(ets, {:cached, module}) do
195-
[{_key, _}] -> :ok
196-
[] -> cache_module({server, ets}, module)
197-
end
198-
end
199-
200188
@doc """
201189
Returns the export kind and deprecation reason for the given MFA from
202190
the cache. If the module does not exist return `{:error, :module}`,
203191
or if the function does not exist return `{:error, :function}`.
204192
"""
205193
@spec fetch_export(cache(), module(), atom(), arity()) ::
206194
{:ok, mode(), kind(), binary() | nil} | {:error, :function | :module}
207-
def fetch_export({_server, ets}, module, fun, arity) do
195+
def fetch_export({server, ets}, module, fun, arity) do
208196
case :ets.lookup(ets, {:cached, module}) do
197+
[] ->
198+
cache_module({server, ets}, module)
199+
fetch_export({server, ets}, module, fun, arity)
200+
209201
[{_key, false}] ->
210202
{:error, :module}
211203

lib/elixir/lib/module/types/of.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,6 @@ defmodule Module.Types.Of do
431431
if Keyword.get(meta, :runtime_module, false) do
432432
context
433433
else
434-
ParallelChecker.preload_module(stack.cache, module)
435434
check_export(module, fun, arity, meta, stack, context)
436435
end
437436
end

0 commit comments

Comments
 (0)