Skip to content

Commit

Permalink
Code style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissainty committed Sep 18, 2020
1 parent b50b0ff commit 7fda94c
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private static FieldIdentifier ToFieldIdentifier(EditContext editContext, string
nextToken = nextToken.Substring(0, nextToken.Length - 1);
var prop = obj.GetType().GetProperty("Item");

if(null != prop)
if (prop is object)
{
// we've got an Item property
var indexerType = prop.GetIndexParameters()[0].ParameterType;
Expand All @@ -157,10 +157,9 @@ private static FieldIdentifier ToFieldIdentifier(EditContext editContext, string
{
// If there is no Item property
// Try to cast the object to array
object[] array = obj as object[];
if (array != null)
if (obj is object[] array)
{
int indexerValue = Convert.ToInt32(nextToken);
var indexerValue = Convert.ToInt32(nextToken);
newObj = array[indexerValue];
}
else
Expand Down

0 comments on commit 7fda94c

Please sign in to comment.