diff --git a/StOptional.java b/StOptional.java index 308d29c..413fe73 100644 --- a/StOptional.java +++ b/StOptional.java @@ -29,8 +29,6 @@ public final class StOptional { * @return boolean true if null or empty, false otherwise */ public static final boolean nullish(Optional o) { - if (o == null || o.isEmpty()) - return true; - return false; + return (o == null || o.isEmpty()); } } diff --git a/example.java b/example.java index f3d8858..5fd00af 100644 --- a/example.java +++ b/example.java @@ -38,8 +38,6 @@ final class StOptional { * @return boolean true if null or empty, false otherwise */ public static final boolean nullish(Optional o) { - if (o == null || o.isEmpty()) - return true; - return false; + return (o == null || o.isEmpty()); } }