Avoid a hash key generation and lookup when inserting in the LockingMechanism (#18243)
* Avoid a hash key generation and lookup when inserting in the LockingMechanism * Added comments for CollectionsMarshal.GetValueRefOrAddDefault * Added further comments and tests. --------- Co-authored-by: Andy Butland <abutland73@gmail.com>
This commit is contained in:
@@ -185,10 +185,7 @@ public class ContentBuilder
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
if (_cultureNames.TryGetValue(culture, out _))
|
||||
{
|
||||
_cultureNames.Remove(culture);
|
||||
}
|
||||
_cultureNames.Remove(culture);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user