From 1bc845f9e484a6e04d6b7696cb4ce2970c3773aa Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 28 Jan 2021 12:45:07 -0600 Subject: [PATCH] Small optimization --- lib/linkify/parser.ex | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/linkify/parser.ex b/lib/linkify/parser.ex index 5791edf..a6c5f3a 100644 --- a/lib/linkify/parser.ex +++ b/lib/linkify/parser.ex @@ -246,11 +246,9 @@ defmodule Linkify.Parser do end defp trim_leading_paren(buffer) do - if String.starts_with?(buffer, "(") do - "(" <> buffer = buffer - buffer - else - buffer + case buffer do + "(" <> buffer -> buffer + buffer -> buffer end end