Skip to content

Commit 47319c3

Browse files
committed
use lookup or insert
1 parent 507ca36 commit 47319c3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/chmatch.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ static SEXP chmatchMain(SEXP x, SEXP table, int nomatch, bool chin, bool chmatch
5959
int nuniq=0;
6060
for (int i=0; i<tablelen; ++i) {
6161
const SEXP s = td[i];
62-
int tl = hash_lookup(marks, s, 0);
63-
if (tl==0) hash_set(marks, s, chmatchdup ? -(++nuniq) : -i-1); // first time seen this string in table
62+
hash_set(marks, s, chmatchdup ? -(++nuniq) : -i-1); // first time seen this string in table
6463
}
6564
// in future if we need NAs in x not to be matched to NAs in table ...
6665
if (chmatchdup) {

0 commit comments

Comments
 (0)