Skip to content

Commit

Permalink
refact: use map.new to save some traversals
Browse files Browse the repository at this point in the history
  • Loading branch information
beligante committed Jun 29, 2023
1 parent 2ee47cd commit 97ea4dc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/absinthe/subscription.ex
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ defmodule Absinthe.Subscription do
pubsub
|> registry_name
|> Registry.lookup(key)
|> Enum.uniq_by(fn {_, {doc_id, _doc}} -> doc_id end)
|> Enum.map(fn match ->
{_, {doc_id, doc}} = match
|> Map.new(fn {_, {doc_id, doc}} ->
doc = Map.update!(doc, :initial_phases, &PipelineSerializer.unpack/1)

{doc_id, doc}
Expand Down

0 comments on commit 97ea4dc

Please sign in to comment.