Cache S7 variable names

This commit is contained in:
Peter Butzhammer
2024-02-06 13:39:55 +01:00
parent 49fe1968d9
commit 9b0749baae
5 changed files with 34 additions and 27 deletions

View File

@@ -12,7 +12,7 @@ namespace Sharp7.Rx
{
private static readonly Regex regex = new Regex(@"^(?<operand>db{1})(?<dbNr>\d{1,4})\.?(?<type>dbx|x|s|string|b|dbb|d|int|dbw|w|dint|dul|dulint|dulong|){1}(?<start>\d+)(\.(?<bitOrLength>\d+))?$", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.CultureInvariant);
private static readonly IReadOnlyDictionary<string, DbType> types = new Dictionary<string, DbType>(StringComparer.InvariantCultureIgnoreCase)
private static readonly IReadOnlyDictionary<string, DbType> types = new Dictionary<string, DbType>(StringComparer.OrdinalIgnoreCase)
{
{"x", DbType.Bit},
{"dbx", DbType.Bit},