aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-05-24 11:59:21 +0200
committerRobert2017-05-29 08:49:52 +0200
commit92486d006dca19ed9931c2cdab3070c5fd0bac82 (patch)
treecbf15b3844c41ddc9513ac515b8f01fefff05c75
parent70381d55a7717c0a0d8b8333f6388e20facb9870 (diff)
downloadchouette-core-92486d006dca19ed9931c2cdab3070c5fd0bac82.tar.bz2
TimeDuration: Use the `duration` argument
Instead of hard-coding the duration to compare against, get it from the function argument. This allows us to set different durations at the time the method is called. Also simplify the comparison, getting rid of the math that makes this method much more difficult to read. Refs #870
-rw-r--r--lib/time_duration.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/time_duration.rb b/lib/time_duration.rb
index 231fff7b8..4d12654c2 100644
--- a/lib/time_duration.rb
+++ b/lib/time_duration.rb
@@ -1,5 +1,5 @@
module TimeDuration
def self.exceeds_gap?(duration, earlier, later)
- (4 * 3600) < ((later - earlier) % (3600 * 24))
+ duration < (later - earlier)
end
end