remove unnecessary AddedVersion member in IIndexType

This commit is contained in:
LukeFZ
2026-02-09 20:15:56 +01:00
parent d9f2fc64dd
commit 52d3176f5c
13 changed files with 8 additions and 22 deletions

View File

@@ -7,7 +7,6 @@ public struct DefaultValueDataIndex(int value) : IIndexType<DefaultValueDataInde
public const string TagPrefix = nameof(DefaultValueDataIndex);
static string IIndexType<DefaultValueDataIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<DefaultValueDataIndex>.AddedVersion => MetadataVersions.V390;
private int _value = value;

View File

@@ -6,8 +6,7 @@ public struct EventIndex(int value) : IIndexType<EventIndex>, IReadable, IEquata
{
public const string TagPrefix = nameof(EventIndex);
static string IIndexType<EventIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<EventIndex>.AddedVersion => MetadataVersions.V390;
static string IIndexType<EventIndex>.TagPrefix => TagPrefix;
private int _value = value;

View File

@@ -7,7 +7,6 @@ public struct FieldIndex(int value) : IIndexType<FieldIndex>, IReadable, IEquata
public const string TagPrefix = nameof(FieldIndex);
static string IIndexType<FieldIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<FieldIndex>.AddedVersion => MetadataVersions.V390;
private int _value = value;

View File

@@ -7,7 +7,6 @@ public struct GenericContainerIndex(int value) : IIndexType<GenericContainerInde
public const string TagPrefix = nameof(GenericContainerIndex);
static string IIndexType<GenericContainerIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<GenericContainerIndex>.AddedVersion => MetadataVersions.V390;
private int _value = value;

View File

@@ -7,7 +7,6 @@ public struct GenericParameterIndex(int value) : IIndexType<GenericParameterInde
public const string TagPrefix = nameof(GenericParameterIndex);
static string IIndexType<GenericParameterIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<GenericParameterIndex>.AddedVersion => MetadataVersions.V390;
private int _value = value;

View File

@@ -6,17 +6,15 @@ public interface IIndexType<T> where T
: IIndexType<T>, allows ref struct
{
public static abstract string TagPrefix { get; }
public static abstract StructVersion AddedVersion { get; }
private static string TagSize4 => $"{T.TagPrefix}4";
private static string TagSize2 => $"{T.TagPrefix}2";
private static string TagSize1 => $"{T.TagPrefix}1";
private static bool HasCustomSize(in StructVersion version)
=> version >= T.AddedVersion
&& version.Tag != null
&& version.Tag.Contains(T.TagPrefix)
&& !version.Tag.Contains(TagSize4);
=> version.Tag != null
&& (version.Tag.Contains(TagSize2)
|| version.Tag.Contains(TagSize1));
public static int IndexSize(in StructVersion version = default, bool is32Bit = false)
{

View File

@@ -6,8 +6,7 @@ public struct InterfacesIndex(int value) : IIndexType<InterfacesIndex>, IReadabl
{
public const string TagPrefix = nameof(InterfacesIndex);
static string IIndexType<InterfacesIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<InterfacesIndex>.AddedVersion => MetadataVersions.V390;
static string IIndexType<InterfacesIndex>.TagPrefix => TagPrefix;
private int _value = value;

View File

@@ -7,7 +7,6 @@ public struct MethodIndex(int value) : IIndexType<MethodIndex>, IReadable, IEqua
public const string TagPrefix = nameof(MethodIndex);
static string IIndexType<MethodIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<MethodIndex>.AddedVersion => MetadataVersions.V390;
private int _value = value;

View File

@@ -6,8 +6,7 @@ public struct NestedTypeIndex(int value) : IIndexType<NestedTypeIndex>, IReadabl
{
public const string TagPrefix = nameof(NestedTypeIndex);
static string IIndexType<NestedTypeIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<NestedTypeIndex>.AddedVersion => MetadataVersions.V390;
static string IIndexType<NestedTypeIndex>.TagPrefix => TagPrefix;
private int _value = value;

View File

@@ -6,8 +6,7 @@ public struct ParameterIndex(int value) : IIndexType<ParameterIndex>, IReadable,
{
public const string TagPrefix = nameof(ParameterIndex);
static string IIndexType<ParameterIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<ParameterIndex>.AddedVersion => MetadataVersions.V390;
static string IIndexType<ParameterIndex>.TagPrefix => TagPrefix;
private int _value = value;

View File

@@ -6,8 +6,7 @@ public struct PropertyIndex(int value) : IIndexType<PropertyIndex>, IReadable, I
{
public const string TagPrefix = nameof(PropertyIndex);
static string IIndexType<PropertyIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<PropertyIndex>.AddedVersion => MetadataVersions.V390;
static string IIndexType<PropertyIndex>.TagPrefix => TagPrefix;
private int _value = value;

View File

@@ -7,7 +7,6 @@ public struct TypeDefinitionIndex(int value) : IIndexType<TypeDefinitionIndex>,
public const string TagPrefix = nameof(TypeDefinitionIndex);
static string IIndexType<TypeDefinitionIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<TypeDefinitionIndex>.AddedVersion => MetadataVersions.V390;
private int _value = value;

View File

@@ -7,7 +7,6 @@ public struct TypeIndex(int value) : IIndexType<TypeIndex>, IReadable, IEquatabl
public const string TagPrefix = nameof(TypeIndex);
static string IIndexType<TypeIndex>.TagPrefix => TagPrefix;
static StructVersion IIndexType<TypeIndex>.AddedVersion => MetadataVersions.V390;
private int _value = value;