Changeset 757 for trunk


Ignore:
Timestamp:
Jan 28, 2009, 12:00:58 AM (12 years ago)
Author:
Peter Johansson
Message:

closes #185 and avoid copying in recursive log function

Location:
trunk/lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Directory.cc

    r750 r757  
    109109
    110110
    111   SVNlog Directory::log_core(void) const
    112   {
    113     SVNlog log(path());
     111  void Directory::log_core(SVNlog& log) const
     112  {
    114113    for (NodeConstIterator i(daughters_.begin()); i != daughters_.end(); ++i)
    115114      log += (*i)->log();
    116     return log;
    117115  }
    118116
  • trunk/lib/Directory.h

    r693 r757  
    66/*
    77  Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson
     8  Copyright (C) 2009 Peter Johansson
    89
    910  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    9091  private:
    9192    /**
    92        @return union of logs from daughter nodes.
     93       add union of logs from daughter nodes.
    9394    */
    94     SVNlog log_core(void) const;
     95    void log_core(SVNlog&) const;
    9596
    9697    ///
  • trunk/lib/File.cc

    r750 r757  
    174174
    175175
    176   SVNlog File::log_core(void) const
    177   {
    178     return SVNlog(path());
     176  void File::log_core(SVNlog&) const
     177  {
    179178  }
    180179
  • trunk/lib/File.h

    r750 r757  
    7777
    7878    /**
    79        @return log of this File.
     79       do nothing
    8080    */
    81     SVNlog log_core(void) const;
     81    void log_core(SVNlog&) const;
    8282
    8383    ///
  • trunk/lib/Node.cc

    r751 r757  
    154154      if (ignore())
    155155        log_ = new SVNlog;
    156       else
    157         log_ = new SVNlog(log_core());
     156      else {
     157        log_ = new SVNlog(path());
     158        log_core(*log_);
     159      }
    158160    }
    159161    return *log_;
     
    205207    if (verbose)
    206208      std::cout << "Printing output for " << path_ << std::endl;
    207     SVNlog log(path_);
     209    const SVNlog& log = this->log();
    208210    typedef std::map<std::string, Stats*>::const_iterator iter;
    209211
  • trunk/lib/Node.h

    r693 r757  
    66/*
    77  Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson
     8  Copyright (C) 2009 Peter Johansson
    89
    910  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    199200  protected:
    200201
    201     virtual SVNlog log_core(void) const=0;
    202 
    203202    ///
    204203    /// print path in html format (with anchors) to @a os
     
    218217    ///
    219218    Node(const Node&);
     219
     220    virtual void log_core(SVNlog&) const=0;
    220221
    221222    virtual void print_core(bool verbose=false) const=0;
Note: See TracChangeset for help on using the changeset viewer.