refactor(il2cpp): share collection availability for counts (#17431)

This commit is contained in:
Vincent Koc
2026-12-06 15:17:19 +08:00
committed by GitHub
parent 737c2a9250
commit 0cb7fef560
@@ -316,6 +316,8 @@ const parseMetadataReport = (
const reusable = isImmutableJsonSnapshot(report);
const cached = reusable ? checkedReports.get(report) : undefined;
if (cached !== undefined) return ok(cached);
const rowCount = (collection: Request["collection"]) =>
rowsFor(report, collection)?.length ?? null;
const methodAddresses =
report.binary == null ? undefined : report.method_addresses;
const checked = {
@@ -334,21 +336,17 @@ const parseMetadataReport = (
events: report.events?.length ?? null,
parameters: report.parameters?.length ?? null,
string_literals: report.string_literals?.length ?? null,
code_gen_modules: report.binary?.code_gen_modules.length ?? null,
code_gen_modules: rowCount("code_gen_modules"),
method_addresses: methodAddresses?.length ?? null,
method_address_states: countStates(methodAddresses),
return_types:
report.binary == null ? null : (report.return_types?.length ?? null),
field_types:
report.binary == null ? null : (report.field_types?.length ?? null),
parameter_types:
report.binary == null ? null : (report.parameter_types?.length ?? null),
return_types: rowCount("return_types"),
field_types: rowCount("field_types"),
parameter_types: rowCount("parameter_types"),
generic_method_instances: report.generic_method_instances?.length ?? null,
generic_method_instance_states: countStates(
report.generic_method_instances,
),
generic_method_issues:
report.binary?.generic_methods?.issues.length ?? null,
generic_method_issues: rowCount("generic_method_issues"),
},
};
if (reusable) checkedReports.set(report, checked);