Minor improvements (#2250)

This commit is contained in:
Cheena Malhotra
2023-09-26 10:16:20 -07:00
committed by GitHub
parent c86b149a1f
commit 78581e8508
6 changed files with 37 additions and 37 deletions

View File

@@ -4,7 +4,7 @@
//
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Globalization;
namespace Microsoft.SqlTools.Utility
@@ -13,7 +13,7 @@ namespace Microsoft.SqlTools.Utility
{
public GeneralRequestDetails()
{
Options = new Dictionary<string, object>(StringComparer.InvariantCultureIgnoreCase);
Options = new ConcurrentDictionary<string, object>(StringComparer.InvariantCultureIgnoreCase);
}
public T GetOptionValue<T>(string name, T defaultValue = default(T))
@@ -96,21 +96,21 @@ namespace Microsoft.SqlTools.Utility
protected void SetOptionValue<T>(string name, T value)
{
Options = Options ?? new Dictionary<string, object>();
Options = Options ?? new ConcurrentDictionary<string, object>();
if (Options.ContainsKey(name))
{
Options[name] = value;
}
else
{
Options.Add(name, value);
Options.TryAdd(name, value);
}
}
/// <summary>
/// Gets or Sets the options
/// </summary>
public Dictionary<string, object> Options { get; set; }
public ConcurrentDictionary<string, object> Options { get; set; }
}
}

View File

@@ -56,7 +56,7 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlContext
/// <summary>
/// default text size
/// </summary>
private const int DefaultTextSize = 2147483647;
private const int DefaultTextSize = int.MaxValue; // 2147483647;
/// <summary>
/// default execution timeout