Browse Source

use MapSet instead of List

merge-requests/13/head
Egor Kislitsyn 5 years ago
parent
commit
99c7ffdbe4
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      lib/auto_linker/parser.ex

+ 2
- 3
lib/auto_linker/parser.ex View File

@ -40,7 +40,7 @@ defmodule AutoLinker.Parser do
"ssb://"
]
@tlds "./priv/tlds.txt" |> File.read!() |> String.split("\n", trim: true)
@tlds "./priv/tlds.txt" |> File.read!() |> String.split("\n", trim: true) |> MapSet.new()
@default_opts ~w(url)a
@ -344,8 +344,7 @@ defmodule AutoLinker.Parser do
true
else
tld = host |> String.split(".") |> List.last()
Enum.member?(@tlds, tld)
MapSet.member?(@tlds, tld)
end
end


Loading…
Cancel
Save