Skip to content

Commit edaae3a

Browse files
committed
remove duplicated code
1 parent 36d004a commit edaae3a

1 file changed

Lines changed: 9 additions & 14 deletions

File tree

lib/iex/lib/iex/autocomplete.ex

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -610,20 +610,15 @@ defmodule IEx.Autocomplete do
610610

611611
defp match_modules(hint, elixir_root?) do
612612
modules =
613-
if elixir_root? do
614-
acc =
615-
for mod <- :erlang.loaded(),
616-
str = Atom.to_string(mod),
617-
String.starts_with?(str, hint),
618-
do: str
619-
620-
if String.starts_with?("Elixir.Elixir", hint), do: ["Elixir.Elixir" | acc], else: acc
621-
else
622-
for mod <- :erlang.loaded(),
623-
str = Atom.to_string(mod),
624-
String.starts_with?(str, hint),
625-
do: str
626-
end
613+
for mod <- :erlang.loaded(),
614+
str = Atom.to_string(mod),
615+
String.starts_with?(str, hint),
616+
do: str
617+
618+
modules =
619+
if elixir_root? and String.starts_with?("Elixir.Elixir", hint),
620+
do: ["Elixir.Elixir" | modules],
621+
else: modules
627622

628623
modules =
629624
case :code.get_mode() do

0 commit comments

Comments
 (0)