public static bool IsLargeToken(CodedTokenType type, TableHeap heap) { MetadataTokenType[] types; if (!_schema.TryGetValue(type, out types)) { throw new UndefinedCodedTokenSchemaException("Schema for coded token: {0} is undefined", type); } int bits = _sizes[type]; int max = 0; for (int i = 0; i < types.Length; i++) { IMetadataTable table; int size = heap.TryGetTable(types[i], out table) ? table.Length : 0; max = Math.Max(size, max); } return(max >= (1 << (16 - bits))); }