Skip to content

Commit 7f5baa0

Browse files
committed
Fixes issue #15
1 parent e42c7a0 commit 7f5baa0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/SplitCode.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,16 +455,17 @@ struct SplitCode {
455455
of << "\n";
456456
if (do_qc) {
457457
of << "\t" << "\"tag_qc\": " << "[" << "\n";
458+
bool first = true;
458459
for (int i = 0; i < qc.size(); i++) {
459460
if (qc[i].size() == 0) continue;
460461
for (int j = 0; j < qc[i].size(); j++) {
462+
if (!first) of << ",";
463+
if (!first) of << "\n";
464+
first = false;
461465
of << "\t\t{\"tag\": \"" << names[i] << "\", \"distance\": " << j << ", \"count\": " << qc[i][j] << "}";
462-
if (!(i == qc.size()-1 && j == qc[i].size()-1)) {
463-
of << ",";
464-
}
465-
of << "\n";
466466
}
467467
}
468+
if (!first) of << "\n";
468469
of << "\t" << "]" << "\n";
469470
}
470471
of << "}" << std::endl;

0 commit comments

Comments
 (0)