Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@colinramsay
Created September 12, 2010 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colinramsay/575970 to your computer and use it in GitHub Desktop.
Save colinramsay/575970 to your computer and use it in GitHub Desktop.
- filtered_sets = filter_sets(sets, set_idxs) unless set_idxs.empty?
+ filtered_sets = sets.values_at(*set_idxs) unless set_idxs.empty?
- def filter_sets(sets, set_idxs)
- filtered_sets = []
-
- sets.each_with_index do |set, index|
- if set_idxs.include?(index)
- log("Adding setidx #{index} with #{set.data_points.length} items to filtered_sets")
- filtered_sets << set
- end
- end
-
- filtered_sets
- end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment