SkiaSharp.TextBlocks icon indicating copy to clipboard operation
SkiaSharp.TextBlocks copied to clipboard

GetGlyphSpan(Font font, string text) Is it okay not to check for null here?

Open yumaojun opened this issue 1 year ago • 2 comments

file \source\SkiaSharp.TextBlocks\TextShaper.cs

Is it okay not to check for null here?

public GlyphSpan GetGlyphSpan(Font font, string text)
        {

            GlyphSpan shape = null;

            **if (GlyphSpanCache != null)**
                lock (CacheLock)
                {
                    GlyphSpanCache.TryGetValue((font, text), out shape);
                }

yumaojun avatar Aug 18 '23 20:08 yumaojun

yeah, that looks like it would make more sense

wouterst79 avatar Aug 18 '23 20:08 wouterst79

Thank you for your reply

yumaojun avatar Aug 28 '23 02:08 yumaojun