Skip to content

Commit

Permalink
Optimize function
Browse files Browse the repository at this point in the history
  • Loading branch information
Micha-kun committed Jun 3, 2020
1 parent 0543964 commit f53c9e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/FSharpx.Extras/ComputationExpressions/Option.fs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ module Option =
/// Maps Unchecked object when null to None, otherwise Some value.
/// It's useful when getting data from external sources, pe.
let inline ofUnchecked (x: 'a when 'a : not struct) =
match box x = null with
| true -> None
| false -> Some x
match box x with
| null -> None
| _ -> Some x

/// Gets the value associated with the option or the supplied default value.
let inline getOrElse v =
Expand Down

0 comments on commit f53c9e1

Please sign in to comment.