Renamed lock vars to match convention

This commit is contained in:
Chomp
2025-04-26 23:12:19 +01:00
parent 4ea4e4ed7c
commit 3b41b551ca
2 changed files with 10 additions and 10 deletions
@@ -5,18 +5,18 @@ namespace SPTarkov.Common.Extensions;
public static class StringExtensions
{
private static readonly Dictionary<string, Regex> RegexCache = new();
private static readonly Lock RegexCacheLock = new();
private static readonly Dictionary<string, Regex> _regexCache = new();
private static readonly Lock _regexCacheLock = new();
public static string RegexReplace(this string source, [StringSyntax(StringSyntaxAttribute.Regex)] string regexString, string newValue)
{
Regex regex;
lock (RegexCacheLock)
lock (_regexCacheLock)
{
if (!RegexCache.TryGetValue(regexString, out regex))
if (!_regexCache.TryGetValue(regexString, out regex))
{
regex = new Regex(regexString);
RegexCache[regexString] = regex;
_regexCache[regexString] = regex;
}
}
@@ -26,12 +26,12 @@ public static class StringExtensions
public static bool RegexMatch(this string source, [StringSyntax(StringSyntaxAttribute.Regex)] string regexString, out Match? matchedString)
{
Regex regex;
lock (RegexCacheLock)
lock (_regexCacheLock)
{
if (!RegexCache.TryGetValue(regexString, out regex))
if (!_regexCache.TryGetValue(regexString, out regex))
{
regex = new Regex(regexString);
RegexCache[regexString] = regex;
_regexCache[regexString] = regex;
}
}
@@ -39,7 +39,7 @@ public class BotController(
{
private readonly BotConfig _botConfig = _configServer.GetConfig<BotConfig>();
private readonly PmcConfig _pmcConfig = _configServer.GetConfig<PmcConfig>();
private static readonly Lock BotListLock = new();
private static readonly Lock _botListLock = new();
/// <summary>
/// Return the number of bot load-out varieties to be generated
@@ -202,7 +202,7 @@ public class BotController(
condition.Limit), // Choose largest between value passed in from request vs what's in bot.config
_botHelper.IsBotPmc(condition.Role));
lock (BotListLock)
lock (_botListLock)
{
result.AddRange(GenerateBotWave(condition, botWaveGenerationDetails, sessionId));
}