Skip to content

Commit 2dd68e8

Browse files
committed
Placate rchk
1 parent 87315a4 commit 2dd68e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/subset.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ SEXP subsetDT(SEXP x, SEXP rows, SEXP cols) { // API change needs update NEWS.md
343343
// but maintain key if ordered subset
344344
SEXP key = getAttrib(x, sym_sorted);
345345
if (length(key)) {
346-
SEXP in = PROTECT(chin(key, getAttrib(ans,R_NamesSymbol))); nprotect++;
346+
SEXP innames = PROTECT(getAttrib(ans,R_NamesSymbol)); nprotect++;
347+
SEXP in = PROTECT(chin(key, innames)); nprotect++;
347348
int i = 0; while(i<LENGTH(key) && LOGICAL(in)[i]) i++;
348349
// i is now the keylen that can be kept. 2 lines above much easier in C than R
349350
if (i==0 || !orderedSubset) {

0 commit comments

Comments
 (0)