lib/rufus/scheduler/job_array.rb in rufus-scheduler-3.2.2 vs lib/rufus/scheduler/job_array.rb in rufus-scheduler-3.3.0
- old
+ new
@@ -51,13 +51,17 @@
@array.size
end
def each(now, &block)
- to_a.sort_by { |j| j.next_time || (now + 1) }.each do |job|
+ to_a.sort_by do |job|
- break unless job.next_time
- break if job.next_time > now
+ job.next_time || (now + 1)
+
+ end.each do |job|
+
+ nt = job.next_time
+ break if ( ! nt) || (nt > now)
block.call(job)
end
end