[Webkit-unassigned] [Bug 147602] [INTL] Implement Intl.NumberFormat.prototype.resolvedOptions ()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 4 12:01:28 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=147602

--- Comment #33 from Sukolsak Sakshuwong <sukolsak at gmail.com> ---
For another optimization, we could use constexpr on computeCurrencySortKey and pre-compute the sort keys like the following. But then, we couldn't use ASSERT inside computeCurrencySortKey. What are your thoughts on this?

static constexpr unsigned computeCurrencySortKey(const char* currency)
{
    return (currency[0] << 16) + (currency[1] << 8) + currency[2];
}

std::pair<unsigned, unsigned> currencyMinorUnits[] = {
    { computeCurrencySortKey("BHD"), 3 },
    { computeCurrencySortKey("BIF"), 0 },
    { computeCurrencySortKey("BYR"), 0 },
    ...
    { computeCurrencySortKey("XPF"), 0 }
};

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160204/8732fbb1/attachment.html>


More information about the webkit-unassigned mailing list