Faster & Shorter Code

Couldn't you just check if the index of their userid is or isn't -1? That would be less coding and it would be faster.