Changeset 1003 for trunk/lib/Stats.cc


Ignore:
Timestamp:
Jan 2, 2010, 3:35:57 AM (12 years ago)
Author:
Peter Johansson
Message:

merging release 0.7.2. Delta 0.7.2 - 0.7.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Stats.cc

    r978 r1003  
    3434#include <cstdlib>
    3535#include <fstream>
     36#include <iostream>
    3637#include <iterator>
    3738#include <map>
     
    277278    std::string str;
    278279    getline(is, str);
    279     if (str!=cache_check_str())
     280    if (str!=cache_check_str()) {
     281      if (str == prev_cache_check_str())
     282        std::cout << "cache file is obsolete; "
     283                  << "retrieving statistics from repository.\n";
    280284      return 0;
     285    }
    281286    svn_revnum_t rev;
    282287    is >> rev;
     
    327332      }
    328333    }
     334  }
     335
     336
     337  unsigned int Stats::max_element(const std::vector<unsigned int>& vec) const
     338  {
     339    return *std::max_element(vec.begin(), vec.end());
    329340  }
    330341
     
    374385    for (std::set<std::string>::const_iterator i=authors_.begin();
    375386         i != authors_.end(); ++i) {
    376       if (lines(*i)) {
    377         assert(stat->find(*i)!=stat->end());
    378         author_cont.push_back(std::make_pair(*i,get_vector(*stat,*i)));
     387      assert(stat->find(*i)!=stat->end());
     388      const std::vector<unsigned int>& vec = get_vector(*stat,*i);
     389      if (max_element(vec)) {
     390        author_cont.push_back(std::make_pair(*i,vec));
    379391      }
    380392    }
Note: See TracChangeset for help on using the changeset viewer.