Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More C API Compliance #1173

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/pluck.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ SEXP extract_vector(SEXP x, SEXP index_i, int i, bool strict) {
return R_NilValue;
}

if (OBJECT(x)) {
if (Rf_isObject(x)) {
// We check `offset` pass the original index to support unordered
// vector classes
SEXP extract_call = PROTECT(Rf_lang3(Rf_install("[["), x, index_i));
Expand Down Expand Up @@ -220,7 +220,7 @@ SEXP pluck_impl(SEXP x, SEXP index, SEXP missing, SEXP strict_arg) {
continue;
}
// Assume all S3 objects implement the vector interface
if (OBJECT(x) && TYPEOF(x) != S4SXP) {
if (Rf_isObject(x) && TYPEOF(x) != S4SXP) {
x = extract_vector(x, index_i, i, strict);
REPROTECT(x, idx);
continue;
Expand Down Expand Up @@ -392,7 +392,7 @@ static int check_obj_length(SEXP n, bool strict) {


int obj_length(SEXP x, bool strict) {
if (!OBJECT(x)) {
if (!Rf_isObject(x)) {
return Rf_length(x);
}

Expand All @@ -409,7 +409,7 @@ int obj_length(SEXP x, bool strict) {
}

SEXP obj_names(SEXP x, bool strict) {
if (!OBJECT(x)) {
if (!Rf_isObject(x)) {
return Rf_getAttrib(x, R_NamesSymbol);
}

Expand Down
Loading