small optimization: set membership is like dictionary lookup, vs array searching