diff options
| author | Teddy Wing | 2017-05-24 11:59:21 +0200 | 
|---|---|---|
| committer | Robert | 2017-05-29 08:49:52 +0200 | 
| commit | 92486d006dca19ed9931c2cdab3070c5fd0bac82 (patch) | |
| tree | cbf15b3844c41ddc9513ac515b8f01fefff05c75 | |
| parent | 70381d55a7717c0a0d8b8333f6388e20facb9870 (diff) | |
| download | chouette-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.rb | 2 | 
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 | 
