From 7b69e8ac1f28fa103c0552fed8d9c05da5f6fe56 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 7 Mar 2021 12:01:35 +0200 Subject: [PATCH] minor optimization: avoid constructing empty string object --- app/src/main/java/net/ktnx/mobileledger/utils/Misc.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/Misc.java b/app/src/main/java/net/ktnx/mobileledger/utils/Misc.java index 5b85f970..197fe6d0 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/Misc.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/Misc.java @@ -62,7 +62,7 @@ public class Misc { } public static String emptyIsNull(String str) { - return "".equals(str) ? null : str; + return str != null && str.isEmpty() ? null : str; } public static String nullIsEmpty(String str) { return (str == null) ? "" : str; -- 2.39.5