Use :binary instead of String in Macro.to_string for bitstrings
No need for grapheme handling and `str` is never of zero size.
This commit is contained in:
@@ -484,7 +484,7 @@ defmodule Macro do
|
||||
else
|
||||
result = Enum.map_join(parts, ", ", fn(part) ->
|
||||
str = bitpart_to_string(part, fun)
|
||||
if String.first(str) == "<" or String.last(str) == ">" do
|
||||
if :binary.first(str) == ?< or :binary.last(str) == ?> do
|
||||
"(" <> str <> ")"
|
||||
else
|
||||
str
|
||||
|
||||
Reference in New Issue
Block a user