Skip to content

Commit

Permalink
use first id to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
harunzengin committed Feb 20, 2024
1 parent 4d4f58e commit f61b7c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xandra/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ defmodule Xandra.Connection do
def connected({:call, from}, {:checkout_state_for_next_request, req_alias}, data) do
{stream_id, data} =
get_and_update_in(data.free_stream_ids, fn ids ->
id = Enum.random(ids)
id = Enum.at(ids, 0)
{id, MapSet.delete(ids, id)}
end)

Expand Down

0 comments on commit f61b7c2

Please sign in to comment.