Skip to content

Commit

Permalink
undup code
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-schwen committed Dec 6, 2023
1 parent 9dd980d commit 5e082b8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/transpose.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,7 @@ SEXP transpose(SEXP l, SEXP fill, SEXP ignoreArg, SEXP keepNamesArg, SEXP return
li = PROTECT(isFactor(li) ? asCharacterFactor(li) : coerceVector(li, maxtype));
} else PROTECT(li); // extra PROTECT just to help rchk by avoiding two counter variables
switch (maxtype) {
case LGLSXP : {
const int *ili = LOGICAL(li);
const int ifill = LOGICAL(fill)[0];
for (int j=0; j<maxlen; ++j) {
LOGICAL(ansp[j+rn])[k] = j<len ? ili[j] : ifill;
}
} break;
case INTSXP : {
case INTSXP : case LGLSXP : {
const int *ili = INTEGER(li);
const int ifill = INTEGER(fill)[0];
for (int j=0; j<maxlen; ++j) {
Expand Down

0 comments on commit 5e082b8

Please sign in to comment.