Skip to content

Commit 86a7c00

Browse files
Removing some checks that were taking a while, and fixing the double initialization of the buffer for istringstream in the sam_rec constructor from string
1 parent 7366058 commit 86a7c00

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sam_record.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ operator<<(std::ostream &the_stream, const sam_rec &r) {
9494

9595
sam_rec::sam_rec(const string &line) {
9696

97-
string tmp;
98-
istringstream iss(line); // ADS: change to set the buffer from "line"
97+
istringstream iss; // ADS: change to set the buffer from "line"
9998
iss.rdbuf()->pubsetbuf(const_cast<char*>(line.c_str()), line.size());
10099
uint32_t will_become_mapq = 0; // to not read mapq as character
101100
// since it's uint8_t
@@ -107,14 +106,15 @@ sam_rec::sam_rec(const string &line) {
107106
throw runtime_error("invalid mapq in SAM record: " + line);
108107
mapq = static_cast<uint8_t>(will_become_mapq);
109108

110-
if (!valid_cigar(cigar, seq))
111-
throw runtime_error("invalid cigar in SAM record: " + line);
109+
// if (!valid_cigar(cigar, seq))
110+
// throw runtime_error("invalid cigar in SAM record: " + line);
112111

113-
if (!valid_seq(seq))
114-
throw runtime_error("invalid read in SAM record: " + line);
112+
// if (!valid_seq(seq))
113+
// throw runtime_error("invalid read in SAM record: " + line);
115114

116-
if (!valid_qual(qual))
117-
throw runtime_error("invalid qual in SAM record: " + line);
115+
// if (!valid_qual(qual))
116+
// throw runtime_error("invalid qual in SAM record: " + line);
117+
string tmp;
118118
while (iss >> tmp)
119119
tags.push_back(tmp);
120120
}

0 commit comments

Comments
 (0)