Skip to content

Commit

Permalink
Remove unneccessary intermediate variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dersmon committed Jul 18, 2024
1 parent 678940f commit 7c84487
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ defmodule FieldPublicationWeb.Presentation.Components.DocumentViewMap do
socket
end

children =
children_features =
doc
|> Data.get_relation_by_name("contains")
|> case do
Expand All @@ -84,6 +84,8 @@ defmodule FieldPublicationWeb.Presentation.Components.DocumentViewMap do
relation ->
Map.get(relation, "values", [])
end
|> Enum.map(&create_feature_info(&1, lang))
|> Enum.filter(fn feature -> Map.has_key?(feature, :geometry) end)

parent_features =
doc
Expand Down Expand Up @@ -117,11 +119,6 @@ defmodule FieldPublicationWeb.Presentation.Components.DocumentViewMap do
geometries_present
end

children_features =
children
|> Enum.map(&create_feature_info(&1, lang))
|> Enum.filter(fn feature -> Map.has_key?(feature, :geometry) end)

document_feature = create_feature_info(doc, lang)

assigns = Map.put(assigns, :type, get_in(document_feature, [:properties, :type]) || "None")
Expand Down

0 comments on commit 7c84487

Please sign in to comment.