Changeset 13721


Ignore:
Timestamp:
Dec 30, 2012, 5:53:12 AM (8 years ago)
Author:
jordan
Message:

rearrange the class' fields by size, saving a few bytes off each Peer and TrackerStat? struct.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/torrent.h

    r13719 r13721  
    4141struct Peer
    4242{
    43     QString address;
    44     QString clientName;
    45     bool clientIsChoked;
    46     bool clientIsInterested;
    47     QString flagStr;
    48     bool isDownloadingFrom;
    49     bool isEncrypted;
    50     bool isIncoming;
    51     bool isUploadingTo;
    52     bool peerIsChoked;
    53     bool peerIsInterested;
    54     int port;
    55     double progress;
    56     Speed rateToClient;
    57     Speed rateToPeer;
     43  bool clientIsChoked;
     44  bool clientIsInterested;
     45  bool isDownloadingFrom;
     46  bool isEncrypted;
     47  bool isIncoming;
     48  bool isUploadingTo;
     49  bool peerIsChoked;
     50  bool peerIsInterested;
     51  QString address;
     52  QString clientName;
     53  QString flagStr;
     54  int port;
     55  Speed rateToClient;
     56  Speed rateToPeer;
     57  double progress;
    5858};
    5959
     
    6464struct TrackerStat
    6565{
    66     QString announce;
    67     int announceState;
    68     int downloadCount;
    69     bool hasAnnounced;
    70     bool hasScraped;
    71     QString host;
    72     int id;
    73     bool isBackup;
    74     int lastAnnouncePeerCount;
    75     QString lastAnnounceResult;
    76     int lastAnnounceStartTime;
    77     bool lastAnnounceSucceeded;
    78     int lastAnnounceTime;
    79     bool lastAnnounceTimedOut;
    80     QString lastScrapeResult;
    81     int lastScrapeStartTime;
    82     bool lastScrapeSucceeded;
    83     int lastScrapeTime;
    84     bool lastScrapeTimedOut;
    85     int leecherCount;
    86     int nextAnnounceTime;
    87     int nextScrapeTime;
    88     int scrapeState;
    89     int seederCount;
    90     int tier;
    91     QPixmap getFavicon( ) const;
     66  bool hasAnnounced;
     67  bool hasScraped;
     68  bool isBackup;
     69  bool lastAnnounceSucceeded;
     70  bool lastAnnounceTimedOut;
     71  bool lastScrapeSucceeded;
     72  bool lastScrapeTimedOut;
     73  int announceState;
     74  int downloadCount;
     75  int id;
     76  int lastAnnouncePeerCount;
     77  int lastAnnounceStartTime;
     78  int lastAnnounceTime;
     79  int lastScrapeStartTime;
     80  int lastScrapeTime;
     81  int leecherCount;
     82  int nextAnnounceTime;
     83  int nextScrapeTime;
     84  int scrapeState;
     85  int seederCount;
     86  int tier;
     87  QString announce;
     88  QString host;
     89  QString lastAnnounceResult;
     90  QString lastScrapeResult;
     91  QPixmap getFavicon( ) const;
    9292};
    9393
     
    9898struct TrFile
    9999{
    100     TrFile(): index(-1), priority(0), wanted(true), size(0), have(0) { }
    101     int index;
    102     int priority;
    103     bool wanted;
    104     uint64_t size;
    105     uint64_t have;
    106     QString filename;
     100  TrFile(): wanted(true), index(-1), priority(0), size(0), have(0) { }
     101
     102  bool wanted;
     103  int index;
     104  int priority;
     105  QString filename;
     106  uint64_t size;
     107  uint64_t have;
    107108};
    108109
Note: See TracChangeset for help on using the changeset viewer.