Changeset 3328


Ignore:
Timestamp:
Oct 10, 2014, 1:41:24 PM (7 years ago)
Author:
Peter
Message:

avoid temporary variables; prefer initialization. refs #806

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/Pileup.h

    r3327 r3328  
    5151    public:
    5252      /**
    53          Create an Entry with first read \a b
     53         Create an Entry with read \a b
    5454       */
    5555      Entry(const yat::omic::BamRead& b);
    5656
    5757      /**
    58          \return const ref to BamRead
     58         \return const reference to BamRead
    5959       */
    6060      const yat::omic::BamRead& bam(void) const { return bam_; }
     
    131131
    132132  private:
     133
     134    /**
     135       Private class used in const_iterator.
     136     */
    133137    class Filter
    134138    {
     
    192196
    193197    /**
    194        \return template id as defined bam file header
     198       \return template id as defined in bam file header
    195199     */
    196200    int32_t tid(void) const { return tid_; }
     
    233237  template<typename Iterator>
    234238  Pileup<Iterator>::Pileup(Iterator first, Iterator last)
    235     : bam_(first), bam_end_(last), skip_ref_(0)
    236   {
    237     tid_ = 0;
    238     pos_ = 0;
     239    : bam_(first), bam_end_(last), pos_(0), tid_(0), skip_ref_(0)
     240  {
    239241    increment();
    240242  }
     
    244246  typename Pileup<Iterator>::const_iterator Pileup<Iterator>::begin(void) const
    245247  {
    246     Filter filter(tid(), pos());
    247     typename std::deque<Entry>::const_iterator iter = data_.begin();
    248     typename std::deque<Entry>::const_iterator end = data_.end();
    249     return boost::make_filter_iterator(filter, iter, end);
     248    return boost::make_filter_iterator(Filter(tid(), pos()),
     249                                       data_.begin(), data_.end());
    250250  }
    251251
     
    254254  typename Pileup<Iterator>::const_iterator Pileup<Iterator>::end(void) const
    255255  {
    256     Filter filter(tid(), pos());
    257     typename std::deque<Entry>::const_iterator end = data_.end();
    258     return boost::make_filter_iterator(filter, end, end);
     256    return boost::make_filter_iterator(Filter(),
     257                                       data_.end(), data_.end());
    259258  }
    260259
Note: See TracChangeset for help on using the changeset viewer.