refactor(il2cpp): pair member table widths with their sections (#16432)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-03 18:49:33 +00:00
1 parent 1586825b62
commit 4f4ff767e8
1 file changed
+7 -14
+7 -14
View File
@@ -38,24 +38,17 @@ export const readIl2cppMemberTables = ({
parameters: 8 + typeIndexWidth,
stringLiterals: indexing === "counted" ? 4 : 8,
};
const literalRecords = checkedSectionCount(
section("stringLiterals"),
recordBytes.stringLiterals,
);
const recordCount = (name: keyof typeof recordBytes) =>
checkedSectionCount(section(name), recordBytes[name]);
const literalRecords = recordCount("stringLiterals");
return {
recordBytes,
literalRecords,
counts: {
fields: checkedSectionCount(section("fields"), recordBytes.fields),
properties: checkedSectionCount(
section("properties"),
recordBytes.properties,
),
events: checkedSectionCount(section("events"), recordBytes.events),
parameters: checkedSectionCount(
section("parameters"),
recordBytes.parameters,
),
fields: recordCount("fields"),
properties: recordCount("properties"),
events: recordCount("events"),
parameters: recordCount("parameters"),
string_literals:
indexing === "counted"
? Math.max(literalRecords - 1, 0)