Skip to content

Commit

Permalink
fix prev_label being possibly overwritten #4
Browse files Browse the repository at this point in the history
  • Loading branch information
bguo068 committed Jun 4, 2022
1 parent 3a6e51a commit 68098a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/positions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "common.hpp"
#include <algorithm>
#include <math.h>

// Positions for a given chromosome
class Positions
Expand Down Expand Up @@ -102,10 +103,10 @@ class Positions

std::vector<region_label_t> label_vec;

size_t prev_label;
for (uint32_t i = 0; i < count_per_2cm.size(); ++i) {

uint32_t label = (count_per_2cm[i] >= min_snp_per_window);
size_t prev_label;
if (i == 0) {
// first label and start
label_vec.push_back({ 0, label });
Expand Down

0 comments on commit 68098a0

Please sign in to comment.