Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.12.0
-
None
-
Patch
Description
Option.java
public static <T> Option<T> fromNullable(T value) { if (value != null) { return new Some<T>(value); } else { return new None<T>(); } }
The None class is an immutable object, therefore it does not need to be instantiated for every call to fromNullable. Do the same thing as Java's Collections.emptyList() to allow for a single static instance of None to return.
Attachments
Issue Links
- links to