Skip to content

Commit

Permalink
Base.length and Base.step for StepRange of MIT return Int, not Duration
Browse files Browse the repository at this point in the history
  • Loading branch information
bbejanov committed Dec 9, 2024
1 parent 726ec66 commit 59d830d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/momentintime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,8 @@ Base.:(:)(start::MIT{F}, step::Duration{F}, stop::MIT{F}) where {F<:Frequency} =

Base.length(rng::UnitRange{<:MIT}) = convert(Int, last(rng) - first(rng) + 1)
Base.step(rng::UnitRange{<:MIT}) = convert(Int, 1)
Base.length(rng::StepRange{<:MIT}) = length(StepRange{Int,Int}(rng.start,rng.step,rng.stop))
Base.step(rng::StepRange{<:MIT}) = step(StepRange{Int,Int}(rng.start,rng.step,rng.stop))

"""
rangeof_span(args...)
Expand Down

0 comments on commit 59d830d

Please sign in to comment.