File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -380,13 +380,13 @@ kmer_counts(const std::vector<std::string> &seqs,
380380 counts.resize (nwords, 0 );
381381 size_t total = 0 ;
382382 for (size_t i = 0 ; i < seqs.size (); ++i) {
383- char seq[ seqs[i].length () + 1 ] ;
384- seq[seqs[i]. length ()] = ' \0 ' ;
385- copy (seqs[i]. begin ( ), seqs[i]. end ( ), seq );
383+ std::vector< char > seq ( seqs[i].length () + 1 , ' \0 ' ) ;
384+ auto seq_data = seq. data () ;
385+ copy (cbegin ( seqs[i]), cend ( seqs[i]), seq_data );
386386 for (size_t j = 0 ; j < seqs[i].length () - k + 1 ; ++j)
387- if (std::count_if (seq + j, seq + j + k, &valid_base) ==
387+ if (std::count_if (seq_data + j, seq_data + j + k, &valid_base) ==
388388 static_cast <int >(k)) {
389- counts[mer2index (seq + j, k)]++;
389+ counts[mer2index (seq_data + j, k)]++;
390390 ++total;
391391 }
392392 }
You can’t perform that action at this time.
0 commit comments