Make _selector_first slightly shorter

Putting the found condition first allows for using an else if instead of nesting an if statement.

Using a temporary variable for the length also trims a few bytes.