Skip to content

Commit 89ba292

Browse files
committed
Simplify rule iteration
Avoid traversing rules twice, just check them all since single occurrences are terminating. Terminating is true as implied for .all? on empty sets.
1 parent 8ee79ec commit 89ba292

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ice_cube/schedule.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def self.from_hash(original_hash, options = {})
384384
# Determine if the schedule will end
385385
# @return [Boolean] true if ending, false if repeating forever
386386
def terminating?
387-
recurrence_rules.empty? || recurrence_rules.all?(&:terminating?)
387+
@all_recurrence_rules.all?(&:terminating?)
388388
end
389389

390390
def hash

0 commit comments

Comments
 (0)