Fix IDE0020

This commit is contained in:
RoosterDragon
2023-02-19 10:08:07 +00:00
committed by Pavel Penev
parent 6d7c73d498
commit 67ba3e55de
2 changed files with 4 additions and 2 deletions

View File

@@ -147,6 +147,9 @@ dotnet_diagnostic.IDE0018.severity = warning
# Use pattern matching to avoid 'as' followed by a 'null' check. # Use pattern matching to avoid 'as' followed by a 'null' check.
dotnet_diagnostic.IDE0019.severity = warning dotnet_diagnostic.IDE0019.severity = warning
# Use pattern matching to avoid 'is' check followed by a cast.
dotnet_diagnostic.IDE0020.severity = warning
# Collection initialization can be simplified # Collection initialization can be simplified
dotnet_diagnostic.IDE0028.severity = warning dotnet_diagnostic.IDE0028.severity = warning

View File

@@ -176,9 +176,8 @@ namespace OpenRA.Scripting
return new LuaCustomClrObject(obj); return new LuaCustomClrObject(obj);
} }
if (obj is Array) if (obj is Array array)
{ {
var array = (Array)obj;
var i = 1; var i = 1;
var table = context.CreateTable(); var table = context.CreateTable();