Skip to content

Commit b7d2310

Browse files
authored
fix short for setting variable set (#1008)
1 parent e1c6b7d commit b7d2310

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Core/Resources/Definitions/CompLevelDefinition.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,20 @@ public void Apply(IConfig config, bool reset = false)
3838
return;
3939

4040
m_setting = true;
41+
ApplyInternal(config, reset);
42+
m_setting = false;
43+
}
44+
45+
private void ApplyInternal(IConfig config, bool reset)
46+
{
4147
if ((CompLevel)config.Compatibility.SessionCompatLevel.ObjectValue != CompLevel)
4248
config.Compatibility.SessionCompatLevel.Set(CompLevel, writeToConfig: false);
4349

4450
if (reset)
4551
config.Compatibility.ResetToUserValues();
4652

4753
if (CompLevel == CompLevel.Undefined)
48-
{
4954
return;
50-
}
5155

5256
var compat = config.Compatibility;
5357
switch (CompLevel)
@@ -86,7 +90,6 @@ public void Apply(IConfig config, bool reset = false)
8690
break;
8791
}
8892

89-
m_setting = false;
9093
HelionLog.Info($"Comp level set to {CompLevel}");
9194
}
9295
}

0 commit comments

Comments
 (0)