File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -103,12 +103,14 @@ static const char *concat(SEXP vec, SEXP idx) {
103103// with missing inputs, and -1 in the positions with column names not
104104// found. Column names not found will eventually cause error via
105105// uniq_diff().
106- SEXP chmatch_na (SEXP x , SEXP table ){
107- SEXP ans ;
108- PROTECT (ans = chmatch (x , table , -1 ));
109- for (int i = 0 ; i < length (ans ); i ++ ){
110- if (STRING_ELT (x , i ) == NA_STRING ){
111- INTEGER (ans )[i ] = NA_INTEGER ;
106+ SEXP chmatch_na (SEXP x , SEXP table )
107+ {
108+ SEXP ans = chmatch (x , table , -1 );
109+ PROTECT (ans );
110+ int * restrict target = INTEGER (ans );
111+ for (int i = 0 ; i < length (ans ); i ++ ) {
112+ if (STRING_ELT (x , i ) == NA_STRING ) {
113+ target [i ] = NA_INTEGER ;
112114 }
113115 }
114116 UNPROTECT (1 );
You can’t perform that action at this time.
0 commit comments