Fix IDE0074
This commit is contained in:
committed by
Pavel Penev
parent
cbd0583289
commit
bd2b3d9793
@@ -600,8 +600,7 @@ namespace OpenRA
|
||||
Lazy<ScriptActorInterface> luaInterface;
|
||||
public void OnScriptBind(ScriptContext context)
|
||||
{
|
||||
if (luaInterface == null)
|
||||
luaInterface = Exts.Lazy(() => new ScriptActorInterface(context, this));
|
||||
luaInterface ??= Exts.Lazy(() => new ScriptActorInterface(context, this));
|
||||
}
|
||||
|
||||
public LuaValue this[LuaRuntime runtime, LuaValue keyValue]
|
||||
|
||||
@@ -535,8 +535,7 @@ namespace OpenRA
|
||||
{
|
||||
object val;
|
||||
|
||||
if (md == null)
|
||||
md = my.ToDictionary();
|
||||
md ??= my.ToDictionary();
|
||||
if (fli.Loader != null)
|
||||
{
|
||||
if (!fli.Attribute.Required || md.ContainsKey(fli.YamlName))
|
||||
|
||||
@@ -167,8 +167,7 @@ namespace OpenRA.Graphics
|
||||
CalculateSpriteGeometry(tl, br, 1, out var spriteSize, out var spriteOffset);
|
||||
CalculateSpriteGeometry(stl, sbr, 2, out var shadowSpriteSize, out var shadowSpriteOffset);
|
||||
|
||||
if (sheetBuilderForFrame == null)
|
||||
sheetBuilderForFrame = new SheetBuilder(SheetType.BGRA, AllocateSheet);
|
||||
sheetBuilderForFrame ??= new SheetBuilder(SheetType.BGRA, AllocateSheet);
|
||||
|
||||
var sprite = sheetBuilderForFrame.Allocate(spriteSize, 0, spriteOffset);
|
||||
var shadowSprite = sheetBuilderForFrame.Allocate(shadowSpriteSize, 0, shadowSpriteOffset);
|
||||
|
||||
@@ -151,8 +151,7 @@ namespace OpenRA
|
||||
|
||||
static List<MiniYamlNode> FromLines(IEnumerable<ReadOnlyMemory<char>> lines, string filename, bool discardCommentsAndWhitespace, Dictionary<string, string> stringPool)
|
||||
{
|
||||
if (stringPool == null)
|
||||
stringPool = new Dictionary<string, string>();
|
||||
stringPool ??= new Dictionary<string, string>();
|
||||
|
||||
var levels = new List<List<MiniYamlNode>>
|
||||
{
|
||||
|
||||
@@ -294,8 +294,7 @@ namespace OpenRA
|
||||
Lazy<ScriptPlayerInterface> luaInterface;
|
||||
public void OnScriptBind(ScriptContext context)
|
||||
{
|
||||
if (luaInterface == null)
|
||||
luaInterface = Exts.Lazy(() => new ScriptPlayerInterface(context, this));
|
||||
luaInterface ??= Exts.Lazy(() => new ScriptPlayerInterface(context, this));
|
||||
}
|
||||
|
||||
public LuaValue this[LuaRuntime runtime, LuaValue keyValue]
|
||||
|
||||
@@ -55,8 +55,7 @@ namespace OpenRA.Support
|
||||
Write();
|
||||
else if (ElapsedMs > thresholdMs)
|
||||
{
|
||||
if (parent.children == null)
|
||||
parent.children = new List<PerfTimer>();
|
||||
parent.children ??= new List<PerfTimer>();
|
||||
parent.children.Add(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user