mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 19:47:14 +00:00
Optimize Version::FixedIssuesExtension#issues_progress by avoiding repeated Issue#closed? calls (#42673).
Since the issues are already filtered by open or closed status using the `open` argument through the `self.open(open)` scope, the call to expensive method `Issue#closed?` can be safely replaced with a check of the `open` argument. Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23747 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c227b006e1
commit
7e4acb6b23
@ -106,7 +106,7 @@ module FixedIssuesExtension
|
||||
done = self.open(open).sum do |c|
|
||||
estimated = c.total_estimated_hours.to_f
|
||||
estimated = estimated_average unless estimated > 0.0
|
||||
ratio = c.closed? ? 100 : (c.done_ratio || 0)
|
||||
ratio = open ? (c.done_ratio || 0) : 100
|
||||
estimated * ratio
|
||||
end
|
||||
progress = done / (estimated_average * issues_count)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user