Reduce work for checking precense of type in opts
This commit is contained in:
parent
1d52bfeb81
commit
61871d137a
1 changed files with 1 additions and 3 deletions
|
@ -334,10 +334,8 @@ defmodule Linkify.Parser do
|
|||
end
|
||||
|
||||
defp link(buffer, opts, user_acc) do
|
||||
opts_list = Map.to_list(opts)
|
||||
|
||||
Enum.reduce_while(@types, {buffer, user_acc}, fn type, _ ->
|
||||
if {type, true} in opts_list do
|
||||
if opts[type] == true do
|
||||
check_and_link_reducer(type, buffer, opts, user_acc)
|
||||
else
|
||||
{:cont, {buffer, user_acc}}
|
||||
|
|
Loading…
Reference in a new issue