Skip to content

Commit

Permalink
PROTECT not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdowle committed May 9, 2021
1 parent f50f1cf commit c927a52
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/fmelt.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,7 @@ SEXP getvarcols(SEXP DT, SEXP dtnames, Rboolean varfactor, Rboolean verbose, str
const int thislen = data->narm ? length(VECTOR_ELT(data->naidx, j)) : data->nrow;
char buff[20];
snprintf(buff, 20, "%d", level++);
SEXP str = PROTECT(mkChar(buff));
for (int k=0; k<thislen; ++k) SET_STRING_ELT(target, ansloc++, str);
UNPROTECT(1);
for (int k=0; k<thislen; ++k) SET_STRING_ELT(target, ansloc++, mkChar(buff));
}
}
} else {// varfactor==TRUE
Expand Down

0 comments on commit c927a52

Please sign in to comment.