Ignore:
Timestamp:
Jan 1, 2010, 11:54:32 PM (12 years ago)
Author:
Peter Johansson
Message:

Fixes #434. Authors are now ignored in the plot if and only if plot
would be y=0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.7-stable/lib/Stats.cc

    r994 r998  
    332332      }
    333333    }
     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());
    334340  }
    335341
     
    380386    for (std::set<std::string>::const_iterator i=authors_.begin();
    381387         i != authors_.end(); ++i) {
    382       if (lines(*i)) {
    383         assert(stat->find(*i)!=stat->end());
    384         author_cont.push_back(std::make_pair(*i,get_vector(*stat,*i)));
     388      assert(stat->find(*i)!=stat->end());
     389      const std::vector<unsigned int>& vec = get_vector(*stat,*i);
     390      if (max_element(vec)) {
     391        author_cont.push_back(std::make_pair(*i,vec));
    385392      }
    386393    }
Note: See TracChangeset for help on using the changeset viewer.