Skip to content

Commit b9df4ac

Browse files
committed
chore: minor refactoring
Signed-off-by: Vincent Biret <[email protected]>
1 parent 521d636 commit b9df4ac

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)