]> git.donarmstrong.com Git - bamtools.git/blobdiff - BamReader.cpp
Minor formatting cleanup in BamIndex.*
[bamtools.git] / BamReader.cpp
index f67a2e63cd68104b5874157f2811240ec58084c0..b1b1b5de2ab79a76416bd5267f6dc5cc1ecccd02 100644 (file)
@@ -540,8 +540,10 @@ bool BamReader::BamReaderPrivate::Jump(int refID, int position) {
         \r
         // if this alignment corresponds to desired position\r
         // return success of seeking back to 'current offset'\r
-        if ( (bAlignment.RefID == refID && bAlignment.Position + bAlignment.Length > position) || (bAlignment.RefID > refID) )\r
+        if ( (bAlignment.RefID == refID && bAlignment.Position + bAlignment.Length > position) || (bAlignment.RefID > refID) ) {\r
+            if ( o != offsets.begin() ) --o;\r
             return mBGZF.Seek(*o);\r
+        }\r
     }\r
     \r
     return result;\r
@@ -737,7 +739,7 @@ bool BamReader::BamReaderPrivate::Rewind(void) {
   \r
     // retrieve first alignment data\r
     BamAlignment al;\r
-    if ( !GetNextAlignmentCore(al) ) return false;\r
+    if ( !LoadNextAlignment(al) ) return false;\r
       \r
     // reset default region info using first alignment in file\r
     Region.LeftRefID      = al.RefID;\r