Skip to content

Commit

Permalink
Remove unused visible_nodes hashes from api element controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Feb 1, 2025
1 parent b8924ed commit 8508c4f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
3 changes: 0 additions & 3 deletions app/controllers/api/relations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,11 @@ def full
node_ids += way_node_ids.flatten
nodes = Node.where(:id => node_ids.uniq).includes(:node_tags)

visible_nodes = {}

@nodes = []
nodes.each do |node|
next unless node.visible? # should be unnecessary if data is consistent.

@nodes << node
visible_nodes[node.id] = node
end

@ways = []
Expand Down
7 changes: 1 addition & 6 deletions app/controllers/api/ways_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,10 @@ def full
@way = Way.includes(:nodes => :node_tags).find(params[:id])

if @way.visible
visible_nodes = {}

@nodes = []

@way.nodes.uniq.each do |node|
if node.visible
@nodes << node
visible_nodes[node.id] = node
end
@nodes << node if node.visible
end

# Render the result
Expand Down

0 comments on commit 8508c4f

Please sign in to comment.