Ignore:
Timestamp:
Nov 26, 2009, 6:47:08 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #2610 "avoid unnecessary calls to time(NULL)"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r9591 r9593  
    672672    tr_torrentUncheck( tor );
    673673
    674     tr_torrentSetAddedDate( tor, time( NULL ) ); /* this is a default value to be
    675                                                     overwritten by the resume file */
     674    tr_torrentSetAddedDate( tor, tr_time( ) ); /* this is a default value to be
     675                                                  overwritten by the resume file */
    676676
    677677    torrentInitFromInfo( tor );
     
    892892tr_torrentStatCached( tr_torrent * tor )
    893893{
    894     const time_t now = time( NULL );
     894    const time_t now = tr_time( );
    895895
    896896    return tr_isTorrent( tor ) && ( now == tor->lastStatTime )
     
    906906
    907907    tor->verifyState = state;
    908     tor->anyDate = time( NULL );
     908    tor->anyDate = tr_time( );
    909909}
    910910
     
    944944    tr_torrentLock( tor );
    945945
    946     tor->lastStatTime = time( NULL );
     946    tor->lastStatTime = tr_time( );
    947947
    948948    s = &tor->stats;
     
    13551355    else
    13561356    {
    1357         const time_t now = time( NULL );
     1357        const time_t now = tr_time( );
    13581358        tor->isRunning = TRUE;
    13591359        tor->needsSeedRatioCheck = TRUE;
     
    15341534    d = tr_bencListAddDict( &tor->session->removedTorrents, 2 );
    15351535    tr_bencDictAddInt( d, "id", tor->uniqueId );
    1536     tr_bencDictAddInt( d, "date", time( NULL ) );
     1536    tr_bencDictAddInt( d, "date", tr_time( ) );
    15371537
    15381538    stopTorrent( tor );
     
    16831683            tr_announcerTorrentCompleted( tor );
    16841684
    1685             tor->doneDate = tor->anyDate = time( NULL );
     1685            tor->doneDate = tor->anyDate = tr_time( );
    16861686        }
    16871687
Note: See TracChangeset for help on using the changeset viewer.