remove another 40M/min of boxing junk by specializing the key comparer on SpriteFont's dict

This commit is contained in:
Chris Forbes
2011-03-06 08:59:25 +13:00
parent 8d1a69e8ff
commit 69ea44310b
2 changed files with 11 additions and 2 deletions

View File

@@ -29,7 +29,8 @@ namespace OpenRA.Graphics
throw new InvalidOperationException("FT_New_Face failed");
FT.FT_Set_Pixel_Sizes(face, 0, (uint)size);
glyphs = new Cache<Pair<char, Color>, GlyphInfo>(CreateGlyph);
glyphs = new Cache<Pair<char, Color>, GlyphInfo>(CreateGlyph,
Pair<char,Color>.EqualityComparer);
// setup a 1-channel SheetBuilder for our private use
if (builder == null) builder = new SheetBuilder(TextureChannel.Alpha);