PartialFunction should not evaluate twice