Skip to content

Commit 78a0abc

Browse files
author
José Valim
committed
Check if we are in the current module context as a fast path
1 parent 0328d86 commit 78a0abc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/elixir/lib/kernel.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3247,7 +3247,7 @@ defmodule Kernel do
32473247
true ->
32483248
fields =
32493249
try do
3250-
case Module.open?(atom) do
3250+
case caller.module == atom or Module.open?(atom) do
32513251
true -> Module.get_attribute(atom, :record_fields)
32523252
false -> atom.__record__(:fields)
32533253
end

0 commit comments

Comments
 (0)