From 2b2c20d7c388ad2a9153d3449cf098afaeba3aba Mon Sep 17 00:00:00 2001 From: Sergei Maximov Date: Wed, 10 Jun 2020 21:49:56 +0300 Subject: [PATCH] Remove duplicate expression from ast_to_html/1 `ExDoc.Formatter.HTML.ast_to_html({tag, attrs, ast})` ends with two equivalent expressions that build the HTML iolist (the former is simply evaluated and discarded), so I removed the latter as it performs an extra concatenation. --- lib/ex_doc/formatter/html.ex | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ex_doc/formatter/html.ex b/lib/ex_doc/formatter/html.ex index 5a63a54d5..ddd83d477 100644 --- a/lib/ex_doc/formatter/html.ex +++ b/lib/ex_doc/formatter/html.ex @@ -128,7 +128,6 @@ defmodule ExDoc.Formatter.HTML do defp ast_to_html({tag, attrs, ast}) do attrs = Enum.map(attrs, fn {key, val} -> " #{key}=\"#{val}\"" end) ["<#{tag}", attrs, ">", ast_to_html(ast), ""] - ["<#{tag}#{attrs}>", ast_to_html(ast), ""] end defp output_setup(build, config) do