Skip to content

Commit

Permalink
Merge pull request #4448 from NickLaMuro/faster_aggregate_service_dat…
Browse files Browse the repository at this point in the history
…a_for_ems_dashboard_service

Use .count, not .length, for better performance
  • Loading branch information
mzazrivec authored Aug 10, 2018
2 parents 5e237ba + 0cff4de commit 424a185
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/services/ems_dashboard_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def format_data(ems_type, attributes, attr_icon, attr_url, attr_hsh)
attr_data = []
attributes.each do |attr|
attr_data.push(
:id => attr_hsh[attr] + '_' + @ems_id,
:id => "#{attr_hsh[attr]}_#{@ems_id}",
:iconClass => attr_icon[attr],
:title => attr_hsh[attr],
:count => @ems.send(attr).length,
:count => @ems.send(attr).count,
:href => get_url(ems_type, @ems_id, attr_url[attr]),
:notification => {
:iconClass => 'pficon pficon-error-circle-o',
Expand Down

0 comments on commit 424a185

Please sign in to comment.