Skip to content

Commit

Permalink
one efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Jul 23, 2024
1 parent 5264546 commit d66c454
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static SEXP rawOneString(unsigned char *bytes, R_xlen_t nbytes, R_xlen_t *np) {

static SEXP nano_inHook(SEXP x, SEXP fun) {

if (!Rf_inherits(x, NANO_STRING(fun)))
if (!Rf_inherits(x, CHAR(fun)))
return R_NilValue;

SEXP newlist, list, newnames, names, out;
Expand Down
5 changes: 1 addition & 4 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,14 +487,11 @@ SEXP rnng_serial_config(SEXP socket, SEXP klass, SEXP sfunc, SEXP ufunc, SEXP ve

} else {

if (TYPEOF(klass) != STRSXP)
Rf_error("'klass' must be a character string or NULL");

SEXPTYPE typ1 = TYPEOF(sfunc);
SEXPTYPE typ2 = TYPEOF(ufunc);
if ((typ1 == CLOSXP || typ1 == SPECIALSXP || typ1 == BUILTINSXP) &&
(typ2 == CLOSXP || typ2 == SPECIALSXP || typ2 == BUILTINSXP)) {
NANO_SET_PROT(socket, Rf_list4(klass, sfunc, ufunc, vec));
NANO_SET_PROT(socket, Rf_list4(STRING_ELT(klass, 0), sfunc, ufunc, vec));
}

}
Expand Down

0 comments on commit d66c454

Please sign in to comment.