Changeset 647


Ignore:
Timestamp:
Jun 4, 2008, 3:51:36 PM (13 years ago)
Author:
Peter Johansson
Message:

using mem_fun_ref

Location:
trunk/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/AddStats.cc

    r642 r647  
    3131#include <cassert>
    3232#include <cstdlib>
     33#include <functional>
    3334#include <map>
    3435#include <string>
     
    6162    RevSet revs;
    6263    std::transform(log.commits().begin(), log.commits().end(),
    63                    std::inserter(revs, revs.begin()), GetRevision());
     64                   std::inserter(revs, revs.begin()),
     65                   std::mem_fun_ref(&Commitment::revision));
    6466    for (RevSet::iterator rev_iter=revs.begin();rev_iter!=revs.end();++rev_iter){
    6567      SVNblame svn_blame(path, *rev_iter);
  • trunk/lib/BlameStats.cc

    r642 r647  
    3636#include <cstdlib>
    3737#include <fstream>
     38#include <functional>
    3839#include <iostream>
    3940#include <iterator>
     
    8384    RevSet revs;
    8485    std::transform(log.commits().begin(), log.commits().end(),
    85                    std::inserter(revs, revs.begin()), GetRevision());
     86                   std::inserter(revs, revs.begin()),
     87                   std::mem_fun_ref(&Commitment::revision));
    8688    for (RevSet::iterator rev_iter=revs.begin();rev_iter!=revs.end();++rev_iter){
    8789      SVNblame svn_blame(path, *rev_iter);
  • trunk/lib/Commitment.h

    r642 r647  
    9393  };
    9494
    95   struct GetAuthor
    96   {
    97     inline const std::string& operator()(const Commitment& commit) const
    98     { return commit.author(); }
    99   };
    100 
    101   struct GetRevision
    102   {
    103     inline svn_revnum_t operator()(const Commitment& commit) const
    104     { return commit.revision(); }
    105   };
    106 
    10795}} // end of namespace svndigest and namespace theplu
    10896
  • trunk/lib/first_page.cc

    r642 r647  
    6060    set<string> authors;
    6161    std::transform(log.commits().begin(), log.commits().end(),
    62                    std::inserter(authors, authors.begin()), GetAuthor());
     62                   std::inserter(authors, authors.begin()),
     63                   std::mem_fun_ref(&Commitment::author));
    6364    // erase invalid authors
    6465    authors.erase("");
Note: See TracChangeset for help on using the changeset viewer.