From dbc2a91b15e6670af563ff78889ffb258bf00edf Mon Sep 17 00:00:00 2001 From: Adam Millerchip Date: Thu, 7 Nov 2019 11:12:57 +0900 Subject: [PATCH] Use a binary comprehension Instead of converting to a charlist and back. --- sample/lib/line_bot_sample.ex | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sample/lib/line_bot_sample.ex b/sample/lib/line_bot_sample.ex index e0b65b4..0fa8217 100644 --- a/sample/lib/line_bot_sample.ex +++ b/sample/lib/line_bot_sample.ex @@ -182,9 +182,7 @@ defmodule LineBotSample do code |> String.trim() |> String.upcase() - |> String.to_charlist() - |> Enum.map(&(&1 + 0x1F1A5)) - |> List.to_string() + |> (&for(<>, into: "", do: <>)).() log_and_reply(request_message, %Message.Text{text: code}, reply_token) end