mirror of
https://github.com/yasirkula/UnityAssetUsageDetector.git
synced 2026-11-19 14:32:37 +08:00
readonly struct optimization
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user