Roles backfill: separate the null and map checks (definite assignment survives mutation)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e97968e271
commit
94f4a9872c
1 changed files with 2 additions and 1 deletions
|
|
@ -1783,7 +1783,8 @@ public static class Program
|
|||
foreach (var field in behavior.GetType().GetFields().Where(f => f.FieldType == typeof(PerformanceStat)))
|
||||
{
|
||||
var stat = field.GetValue(behavior) as PerformanceStat;
|
||||
if (stat == null || !map.TryGetValue(field.Name, out var role)) continue;
|
||||
if (stat == null) continue;
|
||||
if (!map.TryGetValue(field.Name, out var role)) continue;
|
||||
stat.Terms ??= new List<StatTerm>();
|
||||
var quality = stat.Terms.FirstOrDefault(t => t.Source == StatSource.Quality);
|
||||
var value = stat.Min;
|
||||
|
|
|
|||
Loading…
Reference in a new issue