(TypeMeta typeMeta, int index)
| 92 | } |
| 93 | |
| 94 | internal void StoreTypeMetaRef(TypeMeta typeMeta, int index) |
| 95 | { |
| 96 | if (index < 0) |
| 97 | { |
| 98 | throw new InvalidDataException("negative type meta index"); |
| 99 | } |
| 100 | |
| 101 | if (index == 0) |
| 102 | { |
| 103 | _firstTypeMetaRef = typeMeta; |
| 104 | _hasFirstTypeMetaRef = true; |
| 105 | return; |
| 106 | } |
| 107 | |
| 108 | if (!_hasFirstTypeMetaRef) |
| 109 | { |
| 110 | throw new InvalidDataException( |
| 111 | $"type meta index gap: index={index}, missing index 0"); |
| 112 | } |
| 113 | |
| 114 | int listIndex = index - 1; |
| 115 | if (listIndex == _typeMetaRefs.Count) |
| 116 | { |
| 117 | _typeMetaRefs.Add(typeMeta); |
| 118 | return; |
| 119 | } |
| 120 | |
| 121 | if (listIndex < _typeMetaRefs.Count) |
| 122 | { |
| 123 | _typeMetaRefs.Set(listIndex, typeMeta); |
| 124 | return; |
| 125 | } |
| 126 | |
| 127 | throw new InvalidDataException( |
| 128 | $"type meta index gap: index={index}, count={_typeMetaRefs.Count + 1}"); |
| 129 | } |
| 130 | |
| 131 | internal bool TryGetTypeMetaByHeader(ulong header, out TypeMeta typeMeta) |
| 132 | { |
no test coverage detected