Skip to content

Commit 68bfae1

Browse files
committed
fix: remove duplicate nullable type includes in raw.table template
1 parent c9a706e commit 68bfae1

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

Template/raw.table.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@ func mapped_kwd(value)
2727
ret to_mapped_kwd(lang, value)
2828
end
2929
~}}
30-
{{~ for nullable_field in table.nullable_fields ~}}
31-
{{~ if nullable_field.is_primitive || nullable_field.is_enum ~}}
32-
include "nullable_{{ nullable_field.fixed_namespace | array.add nullable_field.type | array.join '_' | string.downcase }}.fbs";
33-
{{~ end ~}}
30+
{{~
31+
include_set = []
32+
for nullable_field in table.nullable_fields
33+
if nullable_field.is_primitive || nullable_field.is_enum
34+
include_str = "include \"nullable_" + (nullable_field.fixed_namespace | array.add nullable_field.type | array.join '_' | string.downcase) + ".fbs\";"
35+
include_set = include_set | array.add include_str | array.uniq
36+
end
37+
end
38+
~}}
39+
{{~ for include_str in include_set ~}}
40+
{{ include_str }}
3441
{{~ end ~}}
3542
{{~ for reference_file in table.reference_files ~}}
3643
include "{{ reference_file }}.fbs";

0 commit comments

Comments
 (0)