undf: assign UNDF numbers, stamp patches; 875 total

This commit is contained in:
russell@unturf.com 2026-03-30 16:45:00 -04:00
parent 0dbb699821
commit 8b5e3c35b1
7 changed files with 177 additions and 1 deletions

View file

@ -0,0 +1,24 @@
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -1332,15 +1332,16 @@
# Returns true if this issue blocks the other issue, otherwise returns false
def blocks?(other)
- all = [self]
+ all = Set.new([self]) # Use Set for O(1) membership instead of Array O(N)
last = [self]
while last.any?
current =
last.map do |i|
i.relations_from.where(:relation_type => IssueRelation::TYPE_BLOCKS).map(&:issue_to)
end.flatten.uniq
- current -= last
- current -= all
+ current.reject! { |c| all.include?(c) } # O(1) per element with Set
return true if current.include?(other)
last = current
- all += last
+ all.merge(last)
end
false
end

View file

@ -0,0 +1,25 @@
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -1352,7 +1352,7 @@
# Returns true if the other issue might be rescheduled if the start/due dates of this issue change
def would_reschedule?(other)
- all = [self]
+ all = Set.new([self]) # Use Set for O(1) membership instead of Array O(N)
last = [self]
while last.any?
current = last.map do |i|
@@ -1360,10 +1360,9 @@
i.leaves.to_a +
i.ancestors.map {|a| a.relations_from.where(:relation_type => IssueRelation::TYPE_PRECEDES).map(&:issue_to)}
end.flatten.uniq
- current -= last
- current -= all
+ current.reject! { |c| all.include?(c) } # O(1) per element with Set
return true if current.include?(other)
last = current
- all += last
+ all.merge(last)
end
false
end