Skip to content

Commit e1d5263

Browse files
committed
Use :binary instead of String in Macro.to_string for bitstrings
No need for grapheme handling and `str` is never of zero size.
1 parent 4855d08 commit e1d5263

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/elixir/lib/macro.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ defmodule Macro do
484484
else
485485
result = Enum.map_join(parts, ", ", fn(part) ->
486486
str = bitpart_to_string(part, fun)
487-
if String.first(str) == "<" or String.last(str) == ">" do
487+
if :binary.first(str) == ?< or :binary.last(str) == ?> do
488488
"(" <> str <> ")"
489489
else
490490
str

0 commit comments

Comments
 (0)