Skip to content

Commit

Permalink
Merge pull request #38 from joegoldman2/feat/frozen-set
Browse files Browse the repository at this point in the history
Use FrozenSet
  • Loading branch information
jbogard authored Sep 27, 2024
2 parents 4e3a389 + 8279200 commit 5ee316e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System.Collections.Generic;
using System.Collections.Frozen;
using MongoDB.Driver.Core.Events;

namespace MongoDB.Driver.Core.Extensions.DiagnosticSources
{
public static class CommandStartedEventExtensions
{
private static readonly HashSet<string> CommandsWithCollectionNameAsValue =
private static readonly FrozenSet<string> CommandsWithCollectionNameAsValue =
new HashSet<string>
{
"aggregate",
Expand All @@ -23,7 +24,7 @@ public static class CommandStartedEventExtensions
"drop",
"createIndexes",
"listIndexes"
};
}.ToFrozenSet();

public static string GetCollectionName(this CommandStartedEvent @event)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Driver.Core" Version="[2.28.0,3.0)" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />
<PackageReference Include="MongoDB.Driver.Core" Version="[2.28.0,3.0)" />
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
</ItemGroup>

</Project>

0 comments on commit 5ee316e

Please sign in to comment.