Skip to content

Commit 57cf7ed

Browse files
Merge pull request #2290 from microsoft/chore/refactoring
chore: minor refactoring
2 parents a5c4d61 + b9df4ac commit 57cf7ed

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Microsoft.OpenApi/Validations/ValidationRule.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ internal override void Evaluate(IValidationContext context, object item)
6666
return;
6767
}
6868

69-
if (item is not T)
69+
if (item is not T typedItem)
7070
{
7171
throw new ArgumentException(string.Format(SRResource.InputItemShouldBeType, typeof(T).FullName));
7272
}
7373

74-
var typedItem = (T)item;
7574
this._validate(context, typedItem);
7675
}
7776
}

0 commit comments

Comments
 (0)