File tree 1 file changed +9
-16
lines changed
1 file changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -251,25 +251,18 @@ int32_t main_rna(int32_t argc, char** argv) {
251
251
return 1 ;
252
252
}
253
253
254
- // taken from https://stackoverflow.com/a/20446239 /
255
- for (auto & filename: transcript_filenames) {
254
+ // taken from https://stackoverflow.com/a/64794991 /
255
+ for (const auto & f : { std::cref ( transcript_filenames), std::cref (intron_filenames)} ) {
256
256
257
- if (filename.size () >= gz_suffix.size () &&
258
- filename.compare (filename.size () - gz_suffix.size (), gz_suffix.size (), gz_suffix) == 0 ) {
257
+ for (auto filename : f.get ()) {
259
258
260
- cerr << " [vg rna] ERROR: Transcript file " << filename << " appears to be gzipped. Decompress it before use." << endl;
261
- return 1 ;
262
- }
263
- }
264
-
265
- // I wish this wasn't copy-pasted but I don't know where a function would go
266
- for (auto & filename: intron_filenames) {
259
+ // taken from https://stackoverflow.com/a/20446239/
260
+ if (filename.size () >= gz_suffix.size () &&
261
+ filename.compare (filename.size () - gz_suffix.size (), gz_suffix.size (), gz_suffix) == 0 ) {
267
262
268
- if (filename.size () >= gz_suffix.size () &&
269
- filename.compare (filename.size () - gz_suffix.size (), gz_suffix.size (), gz_suffix) == 0 ) {
270
-
271
- cerr << " [vg rna] ERROR: Intron file " << filename << " appears to be gzipped. Decompress it before use." << endl;
272
- return 1 ;
263
+ cerr << " [vg rna] ERROR: Annotation file " << filename << " appears to be gzipped. Decompress it before use." << endl;
264
+ return 1 ;
265
+ }
273
266
}
274
267
}
275
268
You can’t perform that action at this time.
0 commit comments