From: Damyan Ivanov Date: Sun, 7 Mar 2021 10:01:35 +0000 (+0200) Subject: minor optimization: avoid constructing empty string object X-Git-Tag: v0.17.0~10 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=7b69e8ac1f28fa103c0552fed8d9c05da5f6fe56;p=mobile-ledger.git minor optimization: avoid constructing empty string object --- 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;