Skip to content

Commit 6601202

Browse files
committed
Simplify string escaping in encoder
1 parent 41336ba commit 6601202

File tree

2 files changed

+140
-140
lines changed

2 files changed

+140
-140
lines changed

lib/codegen.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ defmodule Jason.Codegen do
123123
end
124124

125125
defp encode_pair({key, value}, encode_args) do
126-
key = IO.iodata_to_binary(Encode.key(key, &escape_key/4))
126+
key = IO.iodata_to_binary(Encode.key(key, &escape_key/3))
127127
key = "\"" <> key <> "\":"
128128
[key, quote(do: Encode.value(unquote(value), unquote_splicing(encode_args)))]
129129
end
130130

131-
defp escape_key(binary, _original, _skip, [] = _tail) do
131+
defp escape_key(binary, _original, _skip) do
132132
check_safe_key!(binary)
133133
binary
134134
end

0 commit comments

Comments
 (0)