From 3b5bfb4bf43dcede67cd00a8bb5c71cc55326ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 21 Oct 2021 17:39:28 +0200 Subject: [PATCH] Avoid initialisation of empty arrays. --- OpenRA.Game/Traits/LintAttributes.cs | 2 +- OpenRA.Game/Widgets/Widget.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Traits/LintAttributes.cs b/OpenRA.Game/Traits/LintAttributes.cs index 8614ae8415..ab8cc5042a 100644 --- a/OpenRA.Game/Traits/LintAttributes.cs +++ b/OpenRA.Game/Traits/LintAttributes.cs @@ -37,7 +37,7 @@ namespace OpenRA.Traits public ActorReferenceAttribute(Type requiredTrait = null, LintDictionaryReference dictionaryReference = LintDictionaryReference.None) { - RequiredTraits = requiredTrait != null ? new[] { requiredTrait } : new Type[0]; + RequiredTraits = requiredTrait != null ? new[] { requiredTrait } : Array.Empty(); DictionaryReference = dictionaryReference; } } diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index d30c5d0dce..97497367c1 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -202,7 +202,7 @@ namespace OpenRA.Widgets public string Y = "0"; public string Width = "0"; public string Height = "0"; - public string[] Logic = { }; + public string[] Logic = Array.Empty(); public ChromeLogic[] LogicObjects { get; private set; } public bool Visible = true; public bool IgnoreMouseOver;