Changeset 58970 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
May 7, 2010, 1:13:54 PM (15 years ago)
Author:
[email protected]
Message:

Slightly more effective way to guarantee a compile-time constant, at
least on gcc.

Reviewed by Alexey Proskuryakov.

  • runtime/NumberPrototype.cpp:

(JSC::numberProtoFuncToString): Use pointer notation instead of array
notation, so the compiler treats the string and its contents as constant.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/NumberPrototype.cpp

    r58964 r58970  
    156156        return jsString(exec, v.toString(exec));
    157157
    158     static const char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
     158    static const char* const digits = "0123456789abcdefghijklmnopqrstuvwxyz";
    159159
    160160    // Fast path for number to character conversion.
Note: See TracChangeset for help on using the changeset viewer.