Skip to content

Commit 6f5cdb7

Browse files
committed
fixed: get_struct_by_name impl
1 parent 1dd6975 commit 6f5cdb7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

core/runtime/info/helper.onyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,10 @@ enum_values :: (E: type_expr) -> [] Type_Info_Enum.Member {
314314
}
315315

316316
get_struct_by_name :: (name: str) -> type_expr {
317-
index := 0;
318317
for type_table {
319-
defer index += 1;
320318
if it.info.kind != .Struct do continue;
321319

322-
if (cast(&Type_Info_Struct) it.info).name == name do return cast(type_expr) index;
320+
if (cast(&Type_Info_Struct) it.info).name == name do return it.type;
323321
}
324322

325323
return void;

0 commit comments

Comments
 (0)