Skip to content

Commit 6b1e168

Browse files
committed
Base.length should return Int
1 parent 1736e0b commit 6b1e168

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "CloseOpenIntervals"
22
uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9"
33
authors = ["chriselrod <[email protected]> and contributors"]
4-
version = "0.1.9"
4+
version = "0.1.10"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/CloseOpenIntervals.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ SafeCloseOpen
6666
@inline Base.step(::AbstractCloseOpen) = 1
6767
@inline Base.last(r::AbstractCloseOpen{<:IntegerType,I}) where {I} = getfield(r,:upper) - 1
6868
@inline Base.last(r::AbstractCloseOpen{<:IntegerType,StaticInt{L}}) where {L} = L - 1
69-
@inline Base.length(r::AbstractCloseOpen) = getfield(r,:upper) - getfield(r,:start)
70-
@inline Base.length(r::AbstractCloseOpen{Zero}) = getfield(r,:upper)
69+
@inline Base.length(r::AbstractCloseOpen) = Int(getfield(r,:upper) - getfield(r,:start))
70+
@inline Base.length(r::AbstractCloseOpen{Zero}) = Int(getfield(r,:upper))
7171

7272
@inline Base.iterate(r::CloseOpen) = (i = Int(first(r)); (i, i))
7373
@inline Base.iterate(r::SafeCloseOpen) = (i = Int(first(r)); i getfield(r, :upper) ? nothing : (i, i))

0 commit comments

Comments
 (0)