Skip to content

Commit fa8c1c8

Browse files
committed
Remove unnecessary type parameters
1 parent 8749131 commit fa8c1c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/varname.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ struct VarName{sym, T<:Tuple}
2323
indexing::T
2424
end
2525

26-
VarName(sym::Symbol, indexing::T = ()) where {T} = VarName{sym, T}(indexing)
26+
VarName(sym::Symbol, indexing::Tuple = ()) = VarName{sym, typeof(indexing)}(indexing)
2727

2828
"""
2929
VarName(vn::VarName, indexing)
3030
3131
Return a copy of `vn` with a new index `indexing`.
3232
"""
33-
function VarName(vn::VarName{sym}, indexing::T = ()) where {sym, T}
34-
return VarName{sym, T}(indexing)
33+
function VarName(vn::VarName, indexing::Tuple = ())
34+
return VarName{getsym(vn), typeof(indexing)}(indexing)
3535
end
3636

3737

@@ -52,7 +52,7 @@ getindexing(vn::VarName) = vn.indexing
5252

5353

5454
Base.hash(vn::VarName, h::UInt) = hash((getsym(vn), getindexing(vn)), h)
55-
Base.:(==)(x::VarName{S}, y::VarName{T}) where {S, T} = S == T && getindexing(x) == getindexing(y)
55+
Base.:(==)(x::VarName, y::VarName) = getsym(x) == getsym(y) && getindexing(x) == getindexing(y)
5656

5757
function Base.show(io::IO, vn::VarName)
5858
print(io, getsym(vn))

0 commit comments

Comments
 (0)