Closed Link2Twenty closed 4 years ago
Hey @Link2Twenty thanks for the issue!
What would be the justification for merging this? I'm not sure it offers readability improvements, and without benchmarks to measure we do not know if it faster (my hunch is that it isn't).
I believe indexOf
is marginally faster but it's only about 1~2k ops/s
I tend to find it more readable this way but maybe that's from MySQL past and using IN
all the time 😅
I believe indexOf is marginally faster but it's only about 1~2k ops/s
I put together a small benchmark and I'm afraid the results don't match up to this expectation. The current code is roughly 1.5 billion ops/s faster.
I think the current code is adequate, I don't think this change is well justified given the benchmarks, and so I'm going to close this. If you feel differently please feel free to make the case and supply empirical evidence that this is a well justified change and we can re-open and merge.
Use indexOf to check several types at once rather than checking one by one