<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [INTL] Implement Intl.NumberFormat.prototype.resolvedOptions ()"
   href="https://bugs.webkit.org/show_bug.cgi?id=147602">bug 147602</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #267624 Flags</td>
           <td>review?
           </td>
           <td>review+
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [INTL] Implement Intl.NumberFormat.prototype.resolvedOptions ()"
   href="https://bugs.webkit.org/show_bug.cgi?id=147602#c18">Comment # 18</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [INTL] Implement Intl.NumberFormat.prototype.resolvedOptions ()"
   href="https://bugs.webkit.org/show_bug.cgi?id=147602">bug 147602</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=267624&amp;action=diff" name="attach_267624" title="Patch">attachment 267624</a> <a href="attachment.cgi?id=267624&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=267624&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=267624&amp;action=review</a>

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlNumberFormat.cpp:92
&gt; +    Vector&lt;String&gt; keyLocaleData({</span >

Seems unfortunate to re-create this vector every time the function is called. Might consider changing the function’s interface to return a const&amp; unless it can involve computing a unique value and using a static NeverDestroyed for this particular case.

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlNumberFormat.cpp:158
&gt; +    for (const auto&amp; currencyMinorUnit : currencyMinorUnits) {</span >

This list might be long enough that's binary search would be faster than a linear one.

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlNumberFormat.cpp:159
&gt; +        if (currency == currencyMinorUnit.first)</span >

Is it correct that this is a case sensitive check?

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlObject.cpp:239
&gt; +        if (std::isnan(doubleValue) || doubleValue &lt; static_cast&lt;double&gt;(minimum) || doubleValue &gt; static_cast&lt;double&gt;(maximum)) {</span >

There is a way to write this without an explicit check for NaN.

    If (!(x &gt;= min &amp;&amp; x &lt;= max))

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlObject.cpp:245
&gt; +        return static_cast&lt;unsigned&gt;(doubleValue);</span >

This has peculiar behavior for max + 0.1; do we have test cases that cover values just slightly under min and slightly over max?</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>