Skip to content

Commit

Permalink
Remove generated function in getIndex of connectivity
Browse files Browse the repository at this point in the history
Co-authored-by: Till Ehrengruber <[email protected]>
  • Loading branch information
lorenzovarese and tehrengruber authored Jul 17, 2024
1 parent 495c747 commit 5f7ac95
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/GridTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -468,15 +468,7 @@ struct Connectivity
dims::Integer
end

@generated function Base.getindex(conn::Connectivity, row::Union{Integer, Colon}, col::Integer)
if row <: Integer
return :(conn.data[row, col])
elseif row <: Colon
return :(conn.data[:, col])
else
throw(ArgumentError("Unsupported index type"))
end
end
Base.getindex(conn::Connectivity, row::Union{Integer, Colon}, col::Integer) = conn.data[row, col]

# Field operator ----------------------------------------------------------------------

Expand Down

0 comments on commit 5f7ac95

Please sign in to comment.