s-u / fastmatch

Fast hashing functions and replacement of match()
18 stars 7 forks source link

Add %in% analogue #3

Closed joshuaulrich closed 7 years ago

joshuaulrich commented 8 years ago

fmatch aims to be a drop-in replacement for match, and %in% is just a simple wrapper around match, so adding a fastmatch analogue to %in% is straight-forward.

Add '\keyword{logic}' to be consistent with base/man/match.Rd.

Fixes #2.

jackwasey commented 8 years ago

But if it's a fast version of %in% it wouldn't do the full match, just return when it finds the first match, and only scan the whole table if it didn't contain a match.

s-u commented 7 years ago

@jackwasey it's not scanning the table - it has to perform the check for every element either way, the hash table is used for the lookup hence no scanning.

One thing to test is if the indirection can cause extra copy of y which would defeat teh purpose, bu tI'll address that separately.