mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 13:28:16 +08:00
fix some nullability issues
This commit is contained in:

committed by
Patrik Svensson

parent
79742ce9e3
commit
e71db7f78c
@ -53,10 +53,7 @@ namespace Spectre.Console.Internal
|
||||
var totalRemaining = total;
|
||||
var distributedTotal = new List<int>();
|
||||
|
||||
if (minimums == null)
|
||||
{
|
||||
minimums = ratios.Select(_ => 0).ToList();
|
||||
}
|
||||
minimums ??= ratios.Select(_ => 0).ToList();
|
||||
|
||||
foreach (var (ratio, minimum) in ratios.Zip(minimums, (a, b) => (a, b)))
|
||||
{
|
||||
|
@ -72,10 +72,7 @@ namespace Spectre.Console.Internal
|
||||
var decoration = DecorationTable.GetDecoration(part);
|
||||
if (decoration != null)
|
||||
{
|
||||
if (effectiveDecoration == null)
|
||||
{
|
||||
effectiveDecoration = Decoration.None;
|
||||
}
|
||||
effectiveDecoration ??= Decoration.None;
|
||||
|
||||
effectiveDecoration |= decoration.Value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user