Skip to content

Commit d6a03aa

Browse files
committed
readonly struct optimization
1 parent 177db66 commit d6a03aa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Plugins/AssetUsageDetector/Editor/VariableGetter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ namespace AssetUsageDetectorNamespace
99
public delegate object VariableGetVal( object obj );
1010

1111
// Custom struct to hold a variable, its important properties and its getter function
12-
public struct VariableGetterHolder
12+
public readonly struct VariableGetterHolder
1313
{
1414
public readonly MemberInfo variable;
1515
public readonly bool isSerializable;
1616
private readonly VariableGetVal getter;
1717

18-
public string Name { get { return variable.Name; } }
19-
public bool IsProperty { get { return variable is PropertyInfo; } }
18+
public readonly string Name { get { return variable.Name; } }
19+
public readonly bool IsProperty { get { return variable is PropertyInfo; } }
2020

2121
public VariableGetterHolder( FieldInfo fieldInfo, VariableGetVal getter, bool isSerializable )
2222
{
@@ -32,7 +32,7 @@ public VariableGetterHolder( PropertyInfo propertyInfo, VariableGetVal getter, b
3232
this.getter = getter;
3333
}
3434

35-
public object Get( object obj )
35+
public readonly object Get( object obj )
3636
{
3737
try
3838
{

0 commit comments

Comments
 (0)