Changeset 3362


Ignore:
Timestamp:
Nov 25, 2014, 11:41:57 AM (8 years ago)
Author:
Peter
Message:

avoid temp variable. refs #794

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/BamReadIterator.cc

    r3360 r3362  
    112112    : Actor(&bf)
    113113  {
     114    using boost::shared_ptr;
    114115#if YAT_HAVE_HTSLIB
    115     hts_itr_t* it = sam_itr_queryi(bf.index(), tid, begin, end);
     116    iter_ = shared_ptr<hts_itr_t>(sam_itr_queryi(bf.index(), tid, begin, end),
     117                                  IndexDestroyer());
    116118#else
    117     bam_iter_t it = bam_iter_query(bf.index(), tid, begin, end);
     119    iter_ =
     120      shared_ptr<__bam_iter_t>(bam_iter_query(bf.index(), tid, begin, end),
     121                               IndexDestroyer());
    118122#endif
    119     if (!it) {
     123    if (!iter_.get()) {
    120124      std::stringstream ss;
    121125      ss << "BamReadIterator constructor: invalid region: ( tid=" << tid
     
    123127      throw utility::runtime_error(ss.str());
    124128    }
    125     // iter_ takes ownership
    126 #if YAT_HAVE_HTSLIB
    127     iter_ = boost::shared_ptr<hts_itr_t>(it, IndexDestroyer());
    128 #else
    129     iter_ = boost::shared_ptr<__bam_iter_t>(it, IndexDestroyer());
    130 #endif
    131     assert(iter_.get());
    132129  }
    133130
Note: See TracChangeset for help on using the changeset viewer.