Skip to content

Commit

Permalink
Return FrozenDictionary from CreateGlyphToElementMap
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinCampbell committed Sep 25, 2024
1 parent 8bd2d17 commit 06451df
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ namespace Microsoft.CodeAnalysis.QuickInfo.Presentation;

internal static class QuickInfoContentBuilder
{
private static readonly FrozenDictionary<Glyph, QuickInfoGlyphElement> s_glyphToElementMap = CreateGlyphToElementMap().ToFrozenDictionary();
private static readonly FrozenDictionary<Glyph, QuickInfoGlyphElement> s_glyphToElementMap = CreateGlyphToElementMap();

private static Dictionary<Glyph, QuickInfoGlyphElement> CreateGlyphToElementMap()
private static FrozenDictionary<Glyph, QuickInfoGlyphElement> CreateGlyphToElementMap()
{
var glyphs = (Glyph[])Enum.GetValues(typeof(Glyph));
var result = new Dictionary<Glyph, QuickInfoGlyphElement>(capacity: glyphs.Length);
Expand All @@ -26,7 +26,7 @@ private static Dictionary<Glyph, QuickInfoGlyphElement> CreateGlyphToElementMap(
result.Add(glyph, new QuickInfoGlyphElement(glyph));
}

return result;
return result.ToFrozenDictionary();
}

public static async Task<QuickInfoContainerElement> BuildInteractiveContentAsync(
Expand Down

0 comments on commit 06451df

Please sign in to comment.