readonly struct optimization

This commit is contained in:
yasirkula
2025-06-01 17:55:12 +03:00
parent 177db66fbd
commit d6a03aa8f2
@@ -9,14 +9,14 @@ namespace AssetUsageDetectorNamespace
public delegate object VariableGetVal( object obj );
// Custom struct to hold a variable, its important properties and its getter function
public struct VariableGetterHolder
public readonly struct VariableGetterHolder
{
public readonly MemberInfo variable;
public readonly bool isSerializable;
private readonly VariableGetVal getter;
public string Name { get { return variable.Name; } }
public bool IsProperty { get { return variable is PropertyInfo; } }
public readonly string Name { get { return variable.Name; } }
public readonly bool IsProperty { get { return variable is PropertyInfo; } }
public VariableGetterHolder( FieldInfo fieldInfo, VariableGetVal getter, bool isSerializable )
{
@@ -32,7 +32,7 @@ namespace AssetUsageDetectorNamespace
this.getter = getter;
}
public object Get( object obj )
public readonly object Get( object obj )
{
try
{