]> source.dussan.org Git - redmine.git/commitdiff
Check inclusion only once (#14015).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 12 May 2013 08:45:40 +0000 (08:45 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 12 May 2013 08:45:40 +0000 (08:45 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11832 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb

index 82c0f2e6324e7d43ea65c3211703e36f334c7edf..8dfa2b53a4108705929ad04db14b0671a78af7ad 100644 (file)
@@ -904,13 +904,15 @@ class Issue < ActiveRecord::Base
       # the children of the current node need to be processed.
       if current_issue.children && (current_issue_status == ePROCESS_CHILDREN_ONLY || current_issue_status == ePROCESS_ALL)
         current_issue.children.each do |child|
-          if (issue_status[child] == eNOT_DISCOVERED) && !except.include?(child)
+          next if except.include?(child)
+
+          if (issue_status[child] == eNOT_DISCOVERED)
             queue << child
             issue_status[child] = ePROCESS_ALL
-          elsif (issue_status[child] == eRELATIONS_PROCESSED) && !except.include?(child)
+          elsif (issue_status[child] == eRELATIONS_PROCESSED)
             queue << child
             issue_status[child] = ePROCESS_CHILDREN_ONLY
-          elsif (issue_status[child] == ePROCESS_RELATIONS_ONLY) && !except.include?(child)
+          elsif (issue_status[child] == ePROCESS_RELATIONS_ONLY)
             queue << child
             issue_status[child] = ePROCESS_ALL
           end
@@ -919,13 +921,15 @@ class Issue < ActiveRecord::Base
 
       # Add related issues to the queue, if they are not already in it.
       current_issue.relations_from.map(&:issue_to).each do |related_issue|
-        if (issue_status[related_issue] == eNOT_DISCOVERED) && !except.include?(related_issue)
+        next if except.include?(related_issue)
+
+        if (issue_status[related_issue] == eNOT_DISCOVERED)
           queue << related_issue
           issue_status[related_issue] = ePROCESS_ALL
-        elsif (issue_status[related_issue] == eRELATIONS_PROCESSED) && !except.include?(related_issue)
+        elsif (issue_status[related_issue] == eRELATIONS_PROCESSED)
           queue << related_issue
           issue_status[related_issue] = ePROCESS_CHILDREN_ONLY
-        elsif (issue_status[related_issue] == ePROCESS_RELATIONS_ONLY) && !except.include?(related_issue)
+        elsif (issue_status[related_issue] == ePROCESS_RELATIONS_ONLY)
           queue << related_issue
           issue_status[related_issue] = ePROCESS_ALL
         end