Skip to content

Commit

Permalink
Use :binary module directly
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Aug 9, 2024
1 parent b55ec78 commit a357ae2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/postgrex/replication_connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ defmodule Postgrex.ReplicationConnection do
"""
@spec decode_lsn(String.t()) :: {:ok, integer} | :error
def decode_lsn(lsn) when is_binary(lsn) do
with [file_id, offset] <- String.split(lsn, "/", trim: true),
with [file_id, offset] <- :binary.split(lsn, "/"),
true <- byte_size(file_id) <= @max_lsn_component_size,
true <- byte_size(offset) <= @max_lsn_component_size,
{file_id, ""} when file_id >= 0 <- Integer.parse(file_id, 16),
Expand Down

0 comments on commit a357ae2

Please sign in to comment.