`keyPathComponentsCount == 1` is checked in several places. It should be pulled out into a temporary variable.