Skip to content

Commit

Permalink
chore: don't enumerate empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Aug 9, 2024
1 parent dc73c3a commit 7991d84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ash/actions/read/calculations.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ defmodule Ash.Actions.Read.Calculations do
drop,
{ash_query, calculations_at_runtime, calculations_in_query},
fn drop, {ash_query, calculations_at_runtime, calculations_in_query} ->
if Enum.any?(ash_query.context[:calculation_dependencies], fn {_source, dest} ->
if Enum.any?(ash_query.context[:calculation_dependencies] || [], fn {_source, dest} ->
drop in dest
end) do
{%{ash_query | calculations: Map.delete(ash_query.calculations, drop)},
Expand All @@ -2043,7 +2043,7 @@ defmodule Ash.Actions.Read.Calculations do

defp used?(ash_query, name) do
Map.has_key?(ash_query, name) ||
Enum.any?(ash_query.context[:calculation_dependencies], fn {_source, dest} ->
Enum.any?(ash_query.context[:calculation_dependencies] || [], fn {_source, dest} ->
name in dest
end)
end
Expand Down

0 comments on commit 7991d84

Please sign in to comment.