From fd49dd606bc0158351e04ab1f9fa9a33caf4c684 Mon Sep 17 00:00:00 2001 From: Yuri Pereira Constante Date: Mon, 18 Dec 2023 12:40:42 -0300 Subject: [PATCH] Optimize parse_flag (#506) --- src/floki_mochi_html.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/floki_mochi_html.erl b/src/floki_mochi_html.erl index e66342d3..54dbe41e 100644 --- a/src/floki_mochi_html.erl +++ b/src/floki_mochi_html.erl @@ -166,14 +166,14 @@ tokens(B, S = #decoder{offset = O}, Acc) -> end. parse_flag({start_tag, B, _, false}) -> - case string:to_lower(binary_to_list(B)) of - "script" -> + case B of + <<"script">> -> script; - "style" -> + <<"style">> -> style; - "title" -> + <<"title">> -> title; - "textarea" -> + <<"textarea">> -> textarea; _ -> none