Changeset 112 for trunk/lib/Stats.cc


Ignore:
Timestamp:
Jun 29, 2006, 11:30:54 AM (15 years ago)
Author:
Peter Johansson
Message:

fixes #27 and added some beauty

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Stats.cc

    r101 r112  
    5151    std::stringstream ss;
    5252    ss << (svn_info.count("Revision") ? svn_info["Revision"] : "0");
    53     ss >> latest_revision_;
     53    ss >> revision_;
     54    ss.clear();
     55    ss << (svn_info.count("Last Changed Rev") ? svn_info["Last Changed Rev"] : "0");
     56    ss >> last_changed_rev_;
    5457  }
    5558
     
    5861  {
    5962    // sum of all users
    60     std::vector<u_int> sum(latest_revision_+1, 0);
     63    std::vector<u_int> sum(revision_+1, 0);
    6164    sum=std::accumulate(map_.begin(), map_.end(), sum,
    6265                        PairValuePlus<std::string,u_int>());
     
    7578    std::vector<u_int> vec=(map_.find(user))->second;
    7679 
    77     if (vec.size() < latest_revision_+1)
    78       vec.insert(vec.end(), latest_revision_+1-vec.size(), 0);
     80    if (vec.size() < revision_+1)
     81      vec.insert(vec.end(), revision_+1-vec.size(), 0);
    7982
    8083    std::vector<u_int> accum(vec.size());
     
    8790    std::vector<u_int>* vec = &(map_[user]);
    8891    if (vec->size() < rev+1){
    89       vec->reserve(latest_revision_ + 1);
     92      vec->reserve(revision_ + 1);
    9093      vec->insert(vec->end(), rev - vec->size(),0);
    9194      vec->push_back(1);
Note: See TracChangeset for help on using the changeset viewer.