[webkit-reviews] review granted: [Bug 95940] Make the String initialization on the function side of String::number() : [Attachment 162730] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 7 12:59:42 PDT 2012


Benjamin Poulain <benjamin at webkit.org> has granted Patrick R. Gansterer
<paroga at paroga.com>'s request for review:
Bug 95940: Make the String initialization on the function side of
String::number()
https://bugs.webkit.org/show_bug.cgi?id=95940

Attachment 162730: Patch
https://bugs.webkit.org/attachment.cgi?id=162730&action=review

------- Additional Comments from Benjamin Poulain <benjamin at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=162730&action=review


Looks good.

> Source/WTF/wtf/text/IntegerToStringConversion.h:56
> +template<typename T, typename UnsignedIntegerType, bool Negative>
> +static typename ConversionTrait<T>::ReturnType
numberToStringImpl(UnsignedIntegerType number, typename
ConversionTrait<T>::AdditionalArgumentType* additionalArgument)

Can you please change this bool with an enum { PositiveNumber, NegativeNumber }


This way the call site would be :
    numberToStringImpl<T, typename
UnsignedIntegerTrait<SignedIntegerType>::Type, NegativeNumber>(-number,
additionalArgument);

I think one compiler (MSVC?) have issues with enum values in templates. If
that's a problem, just go with the bool.


More information about the webkit-reviews mailing list