Skip to content

Commit

Permalink
use a tuple instead of Ref in broadcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Jun 1, 2024
1 parent 10cf413 commit 0442058
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ConstructionBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ tuple_or_ntuple(::Type, names, vals) = error("Only Int and Symbol propertynames
if VERSION >= v"1.7"
function getproperties(obj)
fnames = propertynames(obj)
tuple_or_ntuple(fnames, getproperty.(Ref(obj), fnames))
tuple_or_ntuple(fnames, getproperty.((obj,), fnames))
end
function getfields(obj::T) where {T}
fnames = fieldnames(T)
NamedTuple{fnames}(getfield.(Ref(obj), fnames))
NamedTuple{fnames}(getfield.((obj,), fnames))
end
else
@generated function getfields(obj)
Expand Down

0 comments on commit 0442058

Please sign in to comment.