Ignore:
Timestamp:
Jan 29, 2009, 12:51:35 PM (12 years ago)
Author:
Peter Johansson
Message:

Change container in SVNlog to be std::set<Commitment>, in order to
avoid copying in SVNlog::operator+=. Previously we had vector, but the
index had no meaning, in other words, the random access was not used.

refs #74

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/first_page.cc

    r751 r759  
    8484  {
    8585    assert(log.commits().size());
    86     Date begin(log.commits()[0].date());
    87     Date end(log.commits().back().date());
     86    Date begin(log.commits().begin()->date());   
     87    Date end(log.latest_commit().date());
    8888    std::string timefmt("%a %b %e %H:%M:%S %Y");
    8989
     
    102102    os << end.difftime(begin);
    103103    os << "</td></tr>\n"
    104        << "<tr><td>Smallest Revision:</td><td>" << log.commits()[0].revision()
    105        << "</td></tr>\n"
    106        << "<tr><td>Largest Revision:</td><td>" <<log.commits().back().revision()
     104       << "<tr><td>Smallest Revision:</td><td>"
     105       << log.commits().begin()->revision()
     106       << "</td></tr>\n"
     107       << "<tr><td>Largest Revision:</td><td>" << log.latest_commit().revision()
    107108       << "</td></tr>\n"
    108109       << "<tr><td>Revision Count:</td><td>" << log.commits().size()
     
    175176    const size_t maxlength = 80;
    176177    const Configuration& conf = Configuration::instance();
    177     typedef std::vector<Commitment>::const_reverse_iterator iter;
     178    typedef SVNlog::container::const_reverse_iterator iter;
     179    size_t count = 0;
    178180    for (iter i=log.commits().rbegin();
    179          i < std::min(log.commits().rbegin()+10,log.commits().rend()); ++i) {
     181         i != log.commits().rend() && count<10; ++i) {
    180182      os << "<tr><td>"
    181183         << anchor(std::string("classic/")+i->author()+"/total/index.html",
     
    216218
    217219      os << "</td></tr>\n";
     220      ++count;
    218221    }
    219222    os << "</table></div>\n";
Note: See TracChangeset for help on using the changeset viewer.