Skip to content

Commit

Permalink
Refactor: Removed an iterator by using Enumerable's partition method
Browse files Browse the repository at this point in the history
  • Loading branch information
edavis10 committed Jan 29, 2010
1 parent 0178a90 commit 420879f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions app/helpers/bulk_time_entries_helper.rb
Expand Up @@ -11,15 +11,7 @@ def label_for_field(field, rnd_id, options = { })
end

def grouped_options_for_issues(issues)
open_issues = []
closed_issues = []
issues.each do |issue|
if issue.closed?
closed_issues << issue
else
open_issues << issue
end
end
closed_issues, open_issues = *issues.partition {|issue| issue.closed?}

html = '<option></option>'
unless open_issues.empty?
Expand Down

0 comments on commit 420879f

Please sign in to comment.