Changeset 703 for trunk/lib/Stats.cc


Ignore:
Timestamp:
Nov 24, 2008, 4:58:58 AM (15 years ago)
Author:
Peter Johansson
Message:

fixed some issues that addresses #338. Want to add some tests before allowing --ignore-cache and closing ticket:338.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Stats.cc

    r693 r703  
    6767                         svn_revnum_t rev) const
    6868  {
     69    assert(rev>0);
    6970    if (vec.empty()){
    7071      // just to allow call to vec.back() below
    7172      vec.resize(1,0);
    7273    }
    73     else if (vec.begin()+rev < vec.end())
    74       std::partial_sum(vec.begin()+rev,vec.end(),vec.begin()+rev);
     74    else if (vec.begin()+rev-1 < vec.end())
     75      std::partial_sum(vec.begin()+rev-1,vec.end(),vec.begin()+rev-1);
    7576    // static_cast to remove annoying compiler warning
    7677    if (vec.size() < static_cast<size_t>(revision()+1))
     
    8182  void Stats::accumulate_stats(svn_revnum_t rev)
    8283  {
     84    if (!rev)
     85      rev = 1;
    8386    for (std::set<std::string>::const_iterator iter(authors().begin());
    8487         iter!=authors().end(); ++iter) {
Note: See TracChangeset for help on using the changeset viewer.