Skip to content

Commit 008abef

Browse files
simplify perhapsDataTableR
1 parent 338711a commit 008abef

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/utils.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,10 +513,7 @@ bool perhapsDataTable(SEXP x) {
513513
return isDataTable(x) || isFrame(x) || isDataList(x);
514514
}
515515
SEXP perhapsDataTableR(SEXP x) {
516-
SEXP ans = PROTECT(allocVector(LGLSXP, 1));
517-
LOGICAL(ans)[0] = (int)perhapsDataTable(x);
518-
UNPROTECT(1);
519-
return ans;
516+
return ScalarLogical(perhapsDataTable(x));
520517
}
521518

522519
void internal_error(const char *call_name, const char *format, ...) {

0 commit comments

Comments
 (0)