From: derek Date: Mon, 22 Nov 2010 17:47:10 +0000 (-0500) Subject: Fixed BamRegion bug: previously only checked if refID was -1, needed to make sure... X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b5e14489be6687825572d6c252f477472021e78c;p=bamtools.git Fixed BamRegion bug: previously only checked if refID was -1, needed to make sure all negative values were invalid --- diff --git a/src/api/BamAux.h b/src/api/BamAux.h index cd91284..bc99cb7 100644 --- a/src/api/BamAux.h +++ b/src/api/BamAux.h @@ -132,9 +132,9 @@ struct API_EXPORT BamRegion { // member functions void clear(void) { LeftRefID = -1; LeftPosition = -1; RightRefID = -1; RightPosition = -1; } - bool isLeftBoundSpecified(void) const { return ( LeftRefID != -1 && LeftPosition != -1 ); } + bool isLeftBoundSpecified(void) const { return ( LeftRefID >= 0 && LeftPosition >= 0 ); } bool isNull(void) const { return ( !isLeftBoundSpecified() && !isRightBoundSpecified() ); } - bool isRightBoundSpecified(void) const { return ( RightRefID != -1 && RightPosition != -1 ); } + bool isRightBoundSpecified(void) const { return ( RightRefID >= 0 && RightPosition >= 0 ); } }; // ----------------------------------------------------------------