Is there a faster way to write this code?

AFAIK the fastest way to do this is using binary pattern matching similar to what is done in Plug.HTML.html_escape/1

7 Likes