Skip to content

Commit

Permalink
Use fieldcount instead of nfields
Browse files Browse the repository at this point in the history
TODO: learn to read docstrings

See also JuliaLang/julia#29977
  • Loading branch information
cmcaine committed Nov 24, 2021
1 parent 9bfa34f commit 89762d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Nauty.jl
Expand Up @@ -50,10 +50,10 @@ macro define_mutable(immutable_struct)

constructors = quote
function $mutable_name(x::$immutable_name)
$mutable_name(ntuple(i->getfield(x, i), length(fieldnames($immutable_name)))...)
$mutable_name(ntuple(i->getfield(x, i), fieldcount($immutable_name))...)
end
function $immutable_name(x::$mutable_name)
$immutable_name(ntuple(i->getfield(x, i), length(fieldnames($mutable_name)))...)
$immutable_name(ntuple(i->getfield(x, i), fieldcount($mutable_name))...)
end
end

Expand Down

0 comments on commit 89762d5

Please sign in to comment.