Changeset 18584 in webkit


Ignore:
Timestamp:
Jan 4, 2007, 10:58:51 AM (18 years ago)
Author:
kmccullo
Message:

Reviewed by Kevin McCullough.

  • kjs/DateMath.cpp: (KJS::getUTCOffset): Don't cache UTC offset.
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r18526 r18584  
     12007-01-04  David Kilzer  <ddkilzer@webkit.org>
     2
     3        Reviewed by Kevin McCullough.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=12070
     6          REGRESSION: KJS::getUTCOffset() caches UTC offset but ignores time zone changes
     7
     8        * kjs/DateMath.cpp:
     9        (KJS::getUTCOffset): Don't cache UTC offset.
     10
    1112007-01-02  Darin Adler  <darin@apple.com>
    212
  • trunk/JavaScriptCore/kjs/DateMath.cpp

    r18514 r18584  
    294294 */
    295295double getUTCOffset() {
    296     static double utcOffset;
    297     static bool utcOffsetInitialized = false;
    298     if (!utcOffsetInitialized) {
    299         tm localt;
    300 
    301         memset(&localt, 0, sizeof(localt));
    302 
    303         // get the difference between this time zone and UTC on Jan 01, 2000 12:00:00 AM
    304         localt.tm_mday = 1;
    305         localt.tm_year = 100;
    306         utcOffset = 946684800.0 - mktime(&localt);
    307 
    308         utcOffset *= msPerSecond;
    309 
    310         utcOffsetInitialized = true;
    311     }
     296    tm localt;
     297
     298    memset(&localt, 0, sizeof(localt));
     299
     300    // get the difference between this time zone and UTC on Jan 01, 2000 12:00:00 AM
     301    localt.tm_mday = 1;
     302    localt.tm_year = 100;
     303    double utcOffset = 946684800.0 - mktime(&localt);
     304
     305    utcOffset *= msPerSecond;
     306
    312307    return utcOffset;
    313308}
Note: See TracChangeset for help on using the changeset viewer.