Skip to content

Commit 1dc3804

Browse files
authored
Small drive-by cleanup: Make constant explicit (#39056)
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.
1 parent 974e6ec commit 1dc3804

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/codegen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3068,7 +3068,7 @@ static bool emit_builtin_call(jl_codectx_t &ctx, jl_cgval_t *ret, jl_value_t *f,
30683068
else if (jl_is_type_type(obj.typ)) {
30693069
jl_value_t *tp0 = jl_tparam0(obj.typ);
30703070
if (jl_is_datatype(tp0) && jl_is_datatype_singleton((jl_datatype_t*)tp0))
3071-
nf = jl_datatype_nfields(jl_typeof(tp0));
3071+
nf = jl_datatype_nfields((jl_value_t*)jl_datatype_type);
30723072
}
30733073
else if (jl_is_concrete_type(obj.typ)) {
30743074
nf = jl_datatype_nfields(obj.typ);

0 commit comments

Comments
 (0)