Skip to content

Commit 46e3670

Browse files
committed
change example for exists
1 parent 3644e68 commit 46e3670

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_cheatsheets/index.md

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

0 commit comments

Comments
 (0)