lib/import/shake_script.rb in tracksperanto-2.3.1 vs lib/import/shake_script.rb in tracksperanto-2.3.2
- old
+ new
@@ -53,18 +53,14 @@
end
end
# Find whether the passed atom includes a [:trk] on any level
def deep_include?(array_or_element, atom_name)
- return true if array_or_element == atom_name
- if array_or_element.is_a?(Array)
- array_or_element.each do | elem |
- if elem == atom_name
- return true
- elsif elem.is_a?(Array)
- return true if deep_include?(elem, atom_name)
- end
- end
+ return false unless array_or_element.is_a?(Array)
+ return true if array_or_element[0] == atom_name
+
+ array_or_element.each do | elem |
+ return true if deep_include?(elem, atom_name)
end
false
end
\ No newline at end of file