/// <inheritdoc/> public uint GetPropertyMapRid(uint typeDefRid) { // Always unsorted, see comment in GetEventMapRid() above if (propertyMapSortedTable == null) { Interlocked.CompareExchange(ref propertyMapSortedTable, new SortedTable(tablesStream.PropertyMapTable, 0), null); } var list = propertyMapSortedTable.FindAllRows(typeDefRid); return(list.Length == 0 ? 0 : list[0]); }
/// <inheritdoc/> public uint GetEventMapRid(uint typeDefRid) { // The EventMap and PropertyMap tables can only be trusted to be sorted if it's // an NGen image and it's the normal #- stream. The IsSorted bit must not be used // to check whether the tables are sorted. See coreclr: md/inc/metamodel.h / IsVerified() if (eventMapSortedTable == null) { Interlocked.CompareExchange(ref eventMapSortedTable, new SortedTable(tablesStream.EventMapTable, 0), null); } var list = eventMapSortedTable.FindAllRows(typeDefRid); return(list.Length == 0 ? 0 : list[0]); }