Changeset 2989


Ignore:
Timestamp:
Feb 23, 2013, 6:35:33 AM (9 years ago)
Author:
Peter
Message:

speedup BamRead::cigar for case when size is not modified.

File:
1 edited

Legend:

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

    r2988 r2989  
    110110  void BamRead::cigar(const std::vector<uint32_t>& c)
    111111  {
     112    // special case when cigar size is not changed
     113    if (c.size() == core().n_cigar) {
     114      if (c.size())
     115        memcpy(bam1_cigar(bam_), &c[0], 4*c.size());
     116      return;
     117    }
     118
    112119    int m_data = bam_->m_data;
    113120    int data_len = bam_->data_len + 4*c.size() - 4*core().n_cigar;
Note: See TracChangeset for help on using the changeset viewer.