From 61871d137af5276d333d91e3eee11132a1c45d8b Mon Sep 17 00:00:00 2001 From: Justin Tormey Date: Mon, 27 Jul 2020 13:37:15 -0500 Subject: [PATCH] Reduce work for checking precense of type in opts --- lib/linkify/parser.ex | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/linkify/parser.ex b/lib/linkify/parser.ex index 759007e..2079776 100644 --- a/lib/linkify/parser.ex +++ b/lib/linkify/parser.ex @@ -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}}