Skip to content

Commit

Permalink
Small drive-by cleanup: Make constant explicit (#39056)
Browse files Browse the repository at this point in the history
This code is a bit of a leftover from when we still had `nfields(::Type)`,
but at this point it was always just returning the number of fields
of `DataType`. I was a bit confused by this code, so I thought
just using `jl_datatype_t` here explicitly makes clear that it does
actually just return said constant.
  • Loading branch information
Keno authored Jan 4, 2021
1 parent 974e6ec commit 1dc3804
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3068,7 +3068,7 @@ static bool emit_builtin_call(jl_codectx_t &ctx, jl_cgval_t *ret, jl_value_t *f,
else if (jl_is_type_type(obj.typ)) {
jl_value_t *tp0 = jl_tparam0(obj.typ);
if (jl_is_datatype(tp0) && jl_is_datatype_singleton((jl_datatype_t*)tp0))
nf = jl_datatype_nfields(jl_typeof(tp0));
nf = jl_datatype_nfields((jl_value_t*)jl_datatype_type);
}
else if (jl_is_concrete_type(obj.typ)) {
nf = jl_datatype_nfields(obj.typ);
Expand Down

0 comments on commit 1dc3804

Please sign in to comment.