Skip to content

Commit

Permalink
Use null for static method 'obj'
Browse files Browse the repository at this point in the history
  • Loading branch information
steveharter committed Feb 9, 2024
1 parent dd20b85 commit 882b935
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/benchmarks/micro/runtime/System.Reflection/Invoke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public void Field_GetStatic_int()
{
for (int i = 0; i < Iterations; i++)
{
s_int = (int)s_staticField_int.GetValue(s_MyClass);
s_int = (int)s_staticField_int.GetValue(null);
}
}

Expand All @@ -278,7 +278,7 @@ public void Field_GetStatic_class()
{
for (int i = 0; i < Iterations; i++)
{
s_class = s_staticField_class.GetValue(s_MyClass);
s_class = s_staticField_class.GetValue(null);
}
}

Expand All @@ -296,7 +296,7 @@ public void Field_GetStatic_struct()
{
for (int i = 0; i < Iterations; i++)
{
s_struct = (MyBlittableStruct)s_staticField_struct.GetValue(s_MyClass);
s_struct = (MyBlittableStruct)s_staticField_struct.GetValue(null);
}
}

Expand All @@ -314,7 +314,7 @@ public void Field_SetStatic_int()
{
for (int i = 0; i < Iterations; i++)
{
s_staticField_int.SetValue(s_MyClass, 42);
s_staticField_int.SetValue(null, 42);
}
}

Expand All @@ -332,7 +332,7 @@ public void Field_SetStatic_class()
{
for (int i = 0; i < Iterations; i++)
{
s_staticField_class.SetValue(s_MyClass, 42);
s_staticField_class.SetValue(null, 42);
}
}

Expand All @@ -350,7 +350,7 @@ public void Field_SetStatic_struct()
{
for (int i = 0; i < Iterations; i++)
{
s_staticField_struct.SetValue(s_MyClass, default(MyBlittableStruct));
s_staticField_struct.SetValue(null, default(MyBlittableStruct));
}
}

Expand Down

0 comments on commit 882b935

Please # to comment.