Skip to content

Commit

Permalink
Avoids R_shallow_duplicate_attr
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Aug 18, 2024
1 parent 5e2e261 commit 4168e0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ Suggests:
rmarkdown,
testthat (>= 3.0.0)
VignetteBuilder: knitr
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Config/testthat/edition: 3
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ichimoku 1.5.3.9000 (development)

#### Updates:

* Internal performance enhancements.

# ichimoku 1.5.3

#### Updates:
Expand Down
6 changes: 3 additions & 3 deletions src/shikokuchuo.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ SEXP _index(SEXP x) {
SEXP _coredata(SEXP x) {

SEXP core;
PROTECT(core = R_shallow_duplicate_attr(x));
SET_ATTRIB(core, R_NilValue);
SET_OBJECT(core, 0);
R_xlen_t xlen = XLENGTH(x);
PROTECT(core = Rf_allocVector(TYPEOF(x), xlen));
memcpy(ICHIMOKU_DATAPTR(core), DATAPTR_RO(x), xlen * sizeof(double));
Rf_dimgets(core, Rf_getAttrib(x, R_DimSymbol));
Rf_dimnamesgets(core, Rf_getAttrib(x, R_DimNamesSymbol));
UNPROTECT(1);
Expand Down

0 comments on commit 4168e0a

Please sign in to comment.