Replace terniary null checks with coalescing.
This commit is contained in:
@@ -104,7 +104,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (Info.SourceCap > 0)
|
||||
{
|
||||
var timedCount = timedTokens.Count(t => t.Source == source);
|
||||
if ((permanent != null ? permanent.Count + timedCount : timedCount) >= Info.SourceCap)
|
||||
if ((permanent?.Count ?? 0) + timedCount >= Info.SourceCap)
|
||||
{
|
||||
// Get timed token from the same source with closest expiration.
|
||||
var expireIndex = timedTokens.FindIndex(t => t.Source == source);
|
||||
|
||||
Reference in New Issue
Block a user