Avoid initialisation of empty arrays.
This commit is contained in:
committed by
abcdefg30
parent
5ff9d9a1f1
commit
3b5bfb4bf4
@@ -37,7 +37,7 @@ namespace OpenRA.Traits
|
|||||||
public ActorReferenceAttribute(Type requiredTrait = null,
|
public ActorReferenceAttribute(Type requiredTrait = null,
|
||||||
LintDictionaryReference dictionaryReference = LintDictionaryReference.None)
|
LintDictionaryReference dictionaryReference = LintDictionaryReference.None)
|
||||||
{
|
{
|
||||||
RequiredTraits = requiredTrait != null ? new[] { requiredTrait } : new Type[0];
|
RequiredTraits = requiredTrait != null ? new[] { requiredTrait } : Array.Empty<Type>();
|
||||||
DictionaryReference = dictionaryReference;
|
DictionaryReference = dictionaryReference;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ namespace OpenRA.Widgets
|
|||||||
public string Y = "0";
|
public string Y = "0";
|
||||||
public string Width = "0";
|
public string Width = "0";
|
||||||
public string Height = "0";
|
public string Height = "0";
|
||||||
public string[] Logic = { };
|
public string[] Logic = Array.Empty<string>();
|
||||||
public ChromeLogic[] LogicObjects { get; private set; }
|
public ChromeLogic[] LogicObjects { get; private set; }
|
||||||
public bool Visible = true;
|
public bool Visible = true;
|
||||||
public bool IgnoreMouseOver;
|
public bool IgnoreMouseOver;
|
||||||
|
|||||||
Reference in New Issue
Block a user