]> git.donarmstrong.com Git - bamtools.git/commitdiff
Fixed NoIndexCaching behavior
authorDerek <derekwbarnett@gmail.com>
Thu, 21 Oct 2010 19:00:03 +0000 (15:00 -0400)
committerDerek <derekwbarnett@gmail.com>
Thu, 21 Oct 2010 19:00:03 +0000 (15:00 -0400)
 * Previous commit lacked the post-jump dump of index data when this
mode is selected.

src/api/BamIndex.cpp

index 222d96d8d03167cab8a1920f574435fd5a85cff4..e47fd289dac22e0d28dfd76319934c6649d0d6f3 100644 (file)
@@ -635,6 +635,12 @@ bool BamStandardIndex::BamStandardIndexPrivate::GetOffsets(const BamRegion& regi
     
     // set flag & return success
     *hasAlignmentsInRegion = (offsets.size() != 0 );
+
+    // if cache mode set to none, dump the data we just loaded
+    if (m_parent->m_cacheMode == BamIndex::NoIndexCaching )
+        ClearReferenceOffsets(region.LeftRefID);
+
+    // return succes
     return true;
 }
 
@@ -1634,6 +1640,12 @@ bool BamToolsIndex::BamToolsIndexPrivate::GetOffset(const BamRegion& region, int
   
     // set flag based on whether an index entry was found for this region
     *hasAlignmentsInRegion = ( indexIter != indexEnd );
+
+    // if cache mode set to none, dump the data we just loaded
+    if (m_parent->m_cacheMode == BamIndex::NoIndexCaching )
+        ClearReferenceOffsets(region.LeftRefID);
+
+    // return success
     return true; 
 }