Skip to content

Commit

Permalink
Avoid STRING_PTR
Browse files Browse the repository at this point in the history
We only need STRING_PTR_RO.
  • Loading branch information
gaborcsardi committed Aug 8, 2024
1 parent a0828a5 commit 0f0a230
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static R_INLINE int hash_string(char *str, int strlen) {

struct hash_table {
SEXP nms;
SEXP *nmsptr;
const SEXP *nmsptr;
SEXP cols;
int *tab;
int tablen;
Expand All @@ -45,7 +45,7 @@ struct hash_table {
static void hash_create(struct hash_table *table, SEXP nms, SEXP cols,
SEXP tab, int max_cols, int npkgs) {
table->nms = nms;
table->nmsptr = STRING_PTR(nms);
table->nmsptr = STRING_PTR_RO(nms);
table->cols = cols;
table->tab = INTEGER(tab);
table->tablen = LENGTH(tab);
Expand Down

0 comments on commit 0f0a230

Please sign in to comment.