Skip to content

Commit 6a3a0ab

Browse files
authored
Replace the use of OBJECT (#6900)
Rf_isObject has existed for a long time, so no compatibility problems envisioned.
1 parent bbdf158 commit 6a3a0ab

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/assign.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ const char *memrecycle(const SEXP target, const SEXP where, const int start, con
11571157
}
11581158
break;
11591159
}
1160-
if (OBJECT(source) && getAttrib(source, R_ClassSymbol)!=R_NilValue) {
1160+
if (isObject(source)) {
11611161
// otherwise coerceVector doesn't call the as.character method for Date, IDate, integer64, nanotime, etc; PR#5189
11621162
// this if() is to save the overhead of the R call eval() when we know there can be no method
11631163
source = PROTECT(eval(PROTECT(lang2(sym_as_character, source)), R_GlobalEnv)); protecti+=2;

src/dogroups.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,10 @@ SEXP keepattr(SEXP to, SEXP from)
516516
SET_ATTRIB(to, ATTRIB(from));
517517
if (isS4(from)) {
518518
to = PROTECT(asS4(to, TRUE, 1));
519-
SET_OBJECT(to, OBJECT(from));
519+
SET_OBJECT(to, isObject(from));
520520
UNPROTECT(1);
521521
} else {
522-
SET_OBJECT(to, OBJECT(from));
522+
SET_OBJECT(to, isObject(from));
523523
}
524524
return to;
525525
}

0 commit comments

Comments
 (0)