]> git.ktnx.net Git - mobile-ledger.git/commitdiff
minor optimization: avoid constructing empty string object
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 7 Mar 2021 10:01:35 +0000 (12:01 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 7 Mar 2021 10:01:35 +0000 (12:01 +0200)
app/src/main/java/net/ktnx/mobileledger/utils/Misc.java

index 5b85f97097a0c35ebeb16c085586f5d749c09008..197fe6d0d1fbbc2645ef7666c2f332bcd01e2c29 100644 (file)
@@ -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;