Skip to content

Commit 699d028

Browse files
c42fandyferris
authored andcommitted
Bugfix for Tuple(::Scalar) (#177)
Remove most Tuple conversion functions now that most types have become subtypes of SArray / MArray. The scalar version of these was buggy.
1 parent 6a292f2 commit 699d028

File tree

5 files changed

+0
-10
lines changed

5 files changed

+0
-10
lines changed

src/MMatrix.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ end
9999
return val
100100
end
101101

102-
@inline Tuple(v::MMatrix) = v.data
103-
104102
macro MMatrix(ex)
105103
if !isa(ex, Expr)
106104
error("Bad input for @MMatrix")

src/MVector.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ end
5353
return val
5454
end
5555

56-
@inline Tuple(v::MVector) = v.data
57-
5856
macro MVector(ex)
5957
if isa(ex, Expr) && ex.head == :vect
6058
return esc(Expr(:call, MVector{length(ex.args)}, Expr(:tuple, ex.args...)))

src/SMatrix.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ function getindex(v::SMatrix, i::Int)
7272
v.data[i]
7373
end
7474

75-
@inline Tuple(v::SMatrix) = v.data
76-
7775
macro SMatrix(ex)
7876
if !isa(ex, Expr)
7977
error("Bad input for @SMatrix")

src/SVector.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ show(io::IO, ::Type{SVector{N, T}}) where {N, T} = print(io, "SVector{$N,$T}")
3737
v.data[i]
3838
end
3939

40-
@inline Tuple(v::SVector) = v.data
41-
4240
# Converting a CartesianIndex to an SVector
4341
convert(::Type{SVector}, I::CartesianIndex) = SVector(I.I)
4442
convert{N}(::Type{SVector{N}}, I::CartesianIndex{N}) = SVector{N}(I.I)

src/Scalar.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ getindex(v::Scalar) = v.data[1]
2121
v.data[1]
2222
end
2323

24-
@inline Tuple(v::Scalar) = (v.data,)
25-
2624
# A lot more compact than the default array show
2725
Base.show(io::IO, ::MIME"text/plain", x::Scalar{T}) where {T} = print(io, "Scalar{$T}(", x.data, ")")
2826

0 commit comments

Comments
 (0)