Skip to content

Commit d393fd1

Browse files
committed
change example for exists
1 parent fc3d230 commit d393fd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_overviews/cheatsheets/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,8 @@ println(upper.getOrElse(""))</code></pre></td>
601601
<td><pre class="highlight"><code>option.exists(f(_))</code></pre>
602602
<em><strong>same as</strong></em>
603603
<pre class="highlight"><code>option match {
604-
case Some(x) if f(x) =&gt; true
605-
case _ =&gt; false
604+
case Some(x) =&gt; f(x)
605+
case None =&gt; false
606606
}</code></pre></td>
607607
<td>Apply predicate on optional value or false if empty</td>
608608
</tr>

0 commit comments

Comments
 (0)