Maybe this version was implemented for performance reasons, but this could also just be: 

```scala
r.collectFirst { case x if x.matches(mediaType) => x.qValue }.getOrElse(0F)
```