Skip to content

Commit 15572f5

Browse files
authored
Remove redundant list construction in String.replace (#15769)
1 parent fee2946 commit 15572f5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/elixir/lib/string.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ defmodule String do
17461746
end
17471747

17481748
defp do_replace(subject, [], _, n) do
1749-
[binary_part(subject, n, byte_size(subject) - n)]
1749+
binary_part(subject, n, byte_size(subject) - n)
17501750
end
17511751

17521752
defp do_replace(subject, [{start, length} | matches], replacement, n) do

0 commit comments

Comments
 (0)