logo

auto_linker

AutoLinker-shim, based on https://git.pleroma.social/pleroma/auto_linker git clone https://hacktivis.me/git/auto_linker.git
commit: 61871d137af5276d333d91e3eee11132a1c45d8b
parent 1d52bfeb81d866bb1e42b81c983af6f68d4c3164
Author: Justin Tormey <jrtormey@gmail.com>
Date:   Mon, 27 Jul 2020 13:37:15 -0500

Reduce work for checking precense of type in opts

Diffstat:

Mlib/linkify/parser.ex4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git 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}}