From 0f0fe0a0f978c8cfc4723962e51d6121dc8523df Mon Sep 17 00:00:00 2001 From: Squibid Date: Wed, 12 Nov 2025 14:06:57 -0500 Subject: [PATCH] revolutionary change in stopping optionals from being my biggest headache --- StOptional.java | 4 +--- example.java | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) 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()); } }