commit: 99c7ffdbe400f7fe2105f39c3904e80c3f9c4d64
parent 03e0fb26b2ead2491f2f13002728c54b6ff58bd6
Author: Egor Kislitsyn <egor@kislitsyn.com>
Date: Tue, 9 Apr 2019 18:44:05 +0700
use MapSet instead of List
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/auto_linker/parser.ex b/lib/auto_linker/parser.ex
@@ -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