Skip to content

Commit

Permalink
Improve encode performance
Browse files Browse the repository at this point in the history
  • Loading branch information
williamthome committed Aug 8, 2024
1 parent d10f7e0 commit f6c41bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/exneus.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ defmodule Exneus do

@spec encode!(term(), encode_options()) :: iodata()
def encode!(term, opts \\ %{}) do
:euneus.encode(term, norm_encode_opts(opts))
:erlang.iolist_to_binary(:euneus_encoder.encode(term, norm_encode_opts(opts)))
end

@spec encode_to_iodata!(term(), encode_options()) :: iodata()
def encode_to_iodata!(term, opts \\ %{}) do
:euneus.encode_to_iodata(term, norm_encode_opts(opts))
:euneus_encoder.encode(term, norm_encode_opts(opts))
end

@spec norm_encode_opts(encode_options()) :: :euneus_encoder.options()
Expand Down

0 comments on commit f6c41bf

Please sign in to comment.