<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [FreeType] ASSERTION FAILED: !lookupForWriting(Extractor::extract(entry)).second in FontCache::getVerticalData()"
   href="https://bugs.webkit.org/show_bug.cgi?id=157132#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [FreeType] ASSERTION FAILED: !lookupForWriting(Extractor::extract(entry)).second in FontCache::getVerticalData()"
   href="https://bugs.webkit.org/show_bug.cgi?id=157132">bug 157132</a>
              from <span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=157132#c2">comment #2</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=277613&amp;action=diff" name="attach_277613" title="Patch">attachment 277613</a> <a href="attachment.cgi?id=277613&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=277613&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=277613&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/platform/graphics/FontCache.cpp:326
&gt; &gt; +        if (!data-&gt;isOpenType()) {
&gt; &gt; +            fontVerticalDataCache().remove(addResult.iterator);
&gt; &gt; +            return nullptr;
&gt; &gt; +        }
&gt; 
&gt; This isn’t good, because it will not cache the negative result and so if
&gt; OpenTypeVerticalData::create returns something that is not OpenType then it
&gt; will call OpenTypeVerticalData::create again and again every time this
&gt; function is called. And it will also add/remove an element to/from the hash
&gt; map every time.
&gt; 
&gt; I think what we want instead is:
&gt; 
&gt;     if (!data-&gt;isOpenType())
&gt;         data = nullptr;
&gt; 
&gt; We will cache a nullptr and not call OpenTypeVerticalData::create again next
&gt; time.</span >

Good point!

<span class="quote">&gt; Separately, I also think it’s peculiar that OpenTypeVerticalData::create can
&gt; create something that returns false to isOpenType. There’s some kind of
&gt; naming mistake there. I would think, given its name, that function would
&gt; return nullptr if the data is &quot;not OpenType&quot;.</span >

Yes, I was also surprised, maybe we could move the initialization to the create method and simply return nullptr . I'll look at it in more detail.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>