Changeset 453


Ignore:
Timestamp:
Aug 18, 2007, 1:18:42 AM (14 years ago)
Author:
Peter Johansson
Message:

fixes #253 - caching log in Node

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Node.cc

    r452 r453  
    4646  Node::Node(const u_int level, const std::string& path,
    4747             const std::string& local_path)
    48     : level_(level), path_(path), stats_(path),
     48    : level_(level), path_(path), stats_(path), log_(NULL), 
    4949      svninfo_(path)
    5050  {
     
    6262    lstat(path.c_str(),&nodestat);   // C api from sys/stat.h
    6363    link_ = S_ISLNK(nodestat.st_mode);
     64  }
     65
     66
     67  Node::~Node(void)
     68  {
     69    if (log_)
     70      delete log_;
    6471  }
    6572
     
    139146
    140147
    141   SVNlog Node::log(void) const
    142   {
    143     if (ignore())
    144       return SVNlog();
    145     return log_core();
     148  const SVNlog& Node::log(void) const
     149  {
     150    if (!log_)
     151      if (ignore())
     152        log_ = new SVNlog;
     153      else
     154        log_ = new SVNlog(log_core());
     155    return *log_;
    146156  }
    147157
  • trunk/lib/Node.h

    r452 r453  
    6363    /// @brief Destructor
    6464    ///
    65     virtual inline ~Node(void) {};
     65    virtual ~Node(void);
    6666
    6767    ///
     
    115115       @return log of this node in a recursive manner.
    116116    */
    117     SVNlog log(void) const;
     117    const SVNlog& log(void) const;
    118118
    119119    /**
     
    218218    bool binary_;
    219219    bool link_;
     220    mutable SVNlog* log_;
    220221    bool svndigest_ignore_;
    221222    SVNinfo svninfo_;
Note: See TracChangeset for help on using the changeset viewer.