Skip to content

Commit

Permalink
faster vector access
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Jun 23, 2024
1 parent b2880ff commit 84cf489
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# ichimoku 1.5.2.9000 (development)

#### Updates:

* Internal performance enhancements.
* Requires secretbase >= 1.0.0.

# ichimoku 1.5.2

#### Updates:

* `archive()` reverts to using SHA256.
* Requires nanonext >= 1.0.0 and mirai >= 1.0.0.

# ichimoku 1.5.1

Expand Down
5 changes: 3 additions & 2 deletions src/shikokuchuo.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <R_ext/Visibility.h>

#define ICHIMOKU_DATAPTR(x) (void *) DATAPTR_RO(x)
#define ICHIMOKU_VECTOR(x) ((const SEXP *) DATAPTR_RO(x))

SEXP xts_IndexSymbol;
SEXP xts_IndexTclassSymbol;
Expand Down Expand Up @@ -290,10 +291,10 @@ SEXP _df(SEXP x) {
src += xlen;
}

idchar = Rf_coerceVector(VECTOR_ELT(df, 5), STRSXP);
idchar = Rf_coerceVector(ICHIMOKU_VECTOR(df)[5], STRSXP);
SET_VECTOR_ELT(df, 5, idchar);

PROTECT(dn2 = VECTOR_ELT(Rf_getAttrib(x, R_DimNamesSymbol), 1));
PROTECT(dn2 = ICHIMOKU_VECTOR(Rf_getAttrib(x, R_DimNamesSymbol))[1]);
R_xlen_t dlen = XLENGTH(dn2);
names = Rf_allocVector(STRSXP, dlen + 2);
Rf_namesgets(df, names);
Expand Down

0 comments on commit 84cf489

Please sign in to comment.